mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-23 21:55:34 +08:00
(OpenEntry): limit returned stream to block length.
This commit is contained in:
parent
9b4dd096e7
commit
8111f52541
@ -125,7 +125,7 @@ namespace GameRes.Formats.Neko
|
||||
return arc.File.CreateStream (entry.Offset, entry.Size);
|
||||
int length;
|
||||
var data = ReadBlock (arc.File.View, pak.Key, entry.Offset, out length);
|
||||
return new MemoryStream (data, false);
|
||||
return new MemoryStream (data, 0, length, false);
|
||||
}
|
||||
|
||||
static ulong KeyFromHash (uint hash)
|
||||
@ -182,7 +182,7 @@ namespace GameRes.Formats.Neko
|
||||
|
||||
int aligned_size = (length+7) & ~7;
|
||||
byte[] buffer = new byte[aligned_size];
|
||||
view.Read (offset+8, buffer, 0, (uint)length);
|
||||
length = view.Read (offset+8, buffer, 0, (uint)length);
|
||||
if (0 != hash)
|
||||
{
|
||||
ulong key = KeyFromHash (hash);
|
||||
|
Loading…
Reference in New Issue
Block a user