Fix zlib with init

This commit is contained in:
Matt Nadareski
2024-03-25 17:10:24 -04:00
parent 9c0d100c2a
commit 2959fdbe9a
2 changed files with 2 additions and 10 deletions

View File

@@ -230,7 +230,6 @@ namespace BinaryObjectScanner.FileType
{
// Inflate the data into the buffer
var zstream = new ZLib.z_stream_s();
var state = new ZLib.inflate_state();
data = new byte[outputFileSize];
unsafe
{
@@ -244,10 +243,7 @@ namespace BinaryObjectScanner.FileType
zstream.avail_out = (uint)data.Length;
zstream.total_out = 0;
state.strm = zstream;
state.mode = ZLib.inflate_mode.HEAD;
zstream.i_state = state;
ZLib.inflateInit_(zstream, ZLib.zlibVersion(), compressedData.Length);
int zret = ZLib.inflate(zstream, 1);
}
}

View File

@@ -88,7 +88,6 @@ namespace BinaryObjectScanner.Packer
{
// Inflate the data into the buffer
var zstream = new ZLib.z_stream_s();
var state = new ZLib.inflate_state();
data = new byte[payload.Length * 4];
unsafe
{
@@ -102,10 +101,7 @@ namespace BinaryObjectScanner.Packer
zstream.avail_out = (uint)data.Length;
zstream.total_out = 0;
state.strm = zstream;
state.mode = ZLib.inflate_mode.HEAD;
zstream.i_state = state;
ZLib.inflateInit_(zstream, ZLib.zlibVersion(), payload.Length);
int zret = ZLib.inflate(zstream, 1);
}
}