Fix inflateInit2() bug when windowBits is 16 or 32.

0db8fd3714
This commit is contained in:
Alex Kocharin 2022-06-08 18:23:19 +03:00
parent b07a436d39
commit a98f90806e

View file

@ -429,6 +429,9 @@ const inflate = (strm, flush) => {
}
//===//
if ((state.wrap & 2) && hold === 0x8b1f) { /* gzip header */
if (state.wbits === 0) {
state.wbits = 15;
}
state.check = 0/*crc32(0L, Z_NULL, 0)*/;
//=== CRC2(state.check, hold);
hbuf[0] = hold & 0xff;