diff --git a/ArcFormats/Nexas/ArcPAC.cs b/ArcFormats/Nexas/ArcPAC.cs index 3857ab17a..7c55dcfa0 100644 --- a/ArcFormats/Nexas/ArcPAC.cs +++ b/ArcFormats/Nexas/ArcPAC.cs @@ -316,7 +316,13 @@ static private byte[] ZstdDecompress (Stream s, uint unpackedSize) using (var ds = new ZstdSharp.DecompressionStream (s)) { var dst = new byte[unpackedSize]; - ds.Read (dst, 0, dst.Length); + int decompressedSize = 0; + + while(decompressedSize < unpackedSize) + { + decompressedSize += ds.Read(dst, decompressedSize, (int)unpackedSize - decompressedSize); + } + return dst; } }