mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-23 13:45:34 +08:00
(OpenSeekableEntry): added capacity prediction and fixed positioning.
This commit is contained in:
parent
128f1f1477
commit
7704f2b34f
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user