mirror of
https://github.com/crskycode/GARbro.git
synced 2026-06-06 13:48:57 +08:00
(OpenSeekableEntry): added capacity prediction and fixed positioning.
This commit is contained in:
@@ -176,8 +176,13 @@ namespace GameRes
|
||||
return input;
|
||||
using (input)
|
||||
{
|
||||
var copy = new MemoryStream ((int)entry.Size);
|
||||
int capacity = (int)entry.Size;
|
||||
var packed_entry = entry as PackedEntry;
|
||||
if (packed_entry != null && packed_entry.UnpackedSize != 0)
|
||||
capacity = (int)packed_entry.UnpackedSize;
|
||||
var copy = new MemoryStream (capacity);
|
||||
input.CopyTo (copy);
|
||||
copy.Position = 0;
|
||||
return copy;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user