mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-23 21:55:34 +08:00
(GRP): return compressed stream on decompression errors.
This commit is contained in:
parent
42dce0e586
commit
efbac265ff
@ -159,6 +159,8 @@ namespace GameRes.Formats.Ankh
|
||||
{
|
||||
var pent = entry as PackedEntry;
|
||||
if (pent != null && pent.IsPacked && pent.Size > 8)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (arc.File.View.AsciiEqual (entry.Offset, "TPW"))
|
||||
return OpenTpw (arc, pent);
|
||||
@ -168,6 +170,11 @@ namespace GameRes.Formats.Ankh
|
||||
&& arc.File.View.AsciiEqual (entry.Offset+8, "RIFF"))
|
||||
return OpenAudio (arc, entry);
|
||||
}
|
||||
catch (Exception X)
|
||||
{
|
||||
System.Diagnostics.Trace.WriteLine (X.Message, "[GRP]");
|
||||
}
|
||||
}
|
||||
return base.OpenEntry (arc, entry);
|
||||
}
|
||||
|
||||
@ -340,7 +347,10 @@ namespace GameRes.Formats.Ankh
|
||||
if (n != 0)
|
||||
count += GetBits (n) + 1;
|
||||
}
|
||||
Binary.CopyOverlapped (output, dst+offset, dst, count);
|
||||
int src = dst + offset;
|
||||
if (src < 0)
|
||||
throw new InvalidDataException();
|
||||
Binary.CopyOverlapped (output, src, dst, count);
|
||||
dst += count;
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user