mirror of
https://github.com/crskycode/GARbro.git
synced 2026-06-06 05:38:48 +08:00
fix: Stream dispose
This commit is contained in:
@@ -267,6 +267,8 @@ namespace GameRes.Formats.NeXAS
|
||||
if (null == pac)
|
||||
return input;
|
||||
if (Compression.NeedDecryptionOnly == pac.PackType)
|
||||
{
|
||||
using (input)
|
||||
{
|
||||
var data = new byte[entry.Size];
|
||||
input.Read (data, 0, data.Length);
|
||||
@@ -274,6 +276,7 @@ namespace GameRes.Formats.NeXAS
|
||||
data[i] = (byte)~data[i];
|
||||
return new BinMemoryStream (data, entry.Name);
|
||||
}
|
||||
}
|
||||
if (null == pent || !pent.IsPacked)
|
||||
return input;
|
||||
|
||||
@@ -295,10 +298,13 @@ namespace GameRes.Formats.NeXAS
|
||||
return new ZLibStream (input, CompressionMode.Decompress);
|
||||
case Compression.Zstd:
|
||||
case Compression.ZstdOrNone:
|
||||
{
|
||||
using (input)
|
||||
{
|
||||
var unpacked = ZstdDecompress (input, pent.UnpackedSize);
|
||||
return new BinMemoryStream (unpacked, entry.Name);
|
||||
}
|
||||
}
|
||||
default:
|
||||
return input;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user