]> git.lizzy.rs Git - zlib.git/blobdiff - inflate.c
Fix inflateInit2() bug when windowBits is 16 or 32.
[zlib.git] / inflate.c
index 82e39be1f71d8d0d284de74a5d653044e578b9d3..2889e3a07d6d425946fc807f0be6b9156ecc1444 100644 (file)
--- a/inflate.c
+++ b/inflate.c
@@ -645,6 +645,8 @@ int flush;
             NEEDBITS(16);
 #ifdef GUNZIP
             if ((state->wrap & 2) && hold == 0x8b1f) {  /* gzip header */
+                if (state->wbits == 0)
+                    state->wbits = 15;
                 state->check = crc32(0L, Z_NULL, 0);
                 CRC2(state->check, hold);
                 INITBITS();