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:
@@ -268,11 +268,14 @@ namespace GameRes.Formats.NeXAS
|
|||||||
return input;
|
return input;
|
||||||
if (Compression.NeedDecryptionOnly == pac.PackType)
|
if (Compression.NeedDecryptionOnly == pac.PackType)
|
||||||
{
|
{
|
||||||
var data = new byte[entry.Size];
|
using (input)
|
||||||
input.Read (data, 0, data.Length);
|
{
|
||||||
for (int i = 0; i < Math.Min (3, data.Length); i++)
|
var data = new byte[entry.Size];
|
||||||
data[i] = (byte)~data[i];
|
input.Read (data, 0, data.Length);
|
||||||
return new BinMemoryStream (data, entry.Name);
|
for (int i = 0; i < Math.Min (3, data.Length); i++)
|
||||||
|
data[i] = (byte)~data[i];
|
||||||
|
return new BinMemoryStream (data, entry.Name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (null == pent || !pent.IsPacked)
|
if (null == pent || !pent.IsPacked)
|
||||||
return input;
|
return input;
|
||||||
@@ -296,8 +299,11 @@ namespace GameRes.Formats.NeXAS
|
|||||||
case Compression.Zstd:
|
case Compression.Zstd:
|
||||||
case Compression.ZstdOrNone:
|
case Compression.ZstdOrNone:
|
||||||
{
|
{
|
||||||
var unpacked = ZstdDecompress (input, pent.UnpackedSize);
|
using (input)
|
||||||
return new BinMemoryStream (unpacked, entry.Name);
|
{
|
||||||
|
var unpacked = ZstdDecompress (input, pent.UnpackedSize);
|
||||||
|
return new BinMemoryStream (unpacked, entry.Name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
return input;
|
return input;
|
||||||
|
|||||||
Reference in New Issue
Block a user