Merge pull request #250 from Soreepeong/fix/sqpackstream-readfileblock

Fix ReadFileBlock (NotAdam/Lumina#42)
This commit is contained in:
Ottermandias 2022-09-16 11:53:46 +02:00 committed by GitHub
commit 93b11fb705
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -334,13 +334,12 @@ public class PenumbraSqPackStream : IDisposable
if( blockHeader.CompressedSize == 32000 )
{
dest.Write( Reader.ReadBytes( ( int )blockHeader.UncompressedSize ) );
return blockHeader.UncompressedSize;
}
else
{
var data = Reader.ReadBytes( ( int )blockHeader.CompressedSize );
using( var compressedStream = new MemoryStream( data ) )
{
using var compressedStream = new MemoryStream( data );
using var zlibStream = new DeflateStream( compressedStream, CompressionMode.Decompress );
zlibStream.CopyTo( dest );
}