Work around zlib bug where using a deflate window size of 8 will

cause memory corruption.
This commit is contained in:
jedgar 2002-03-23 13:05:53 +00:00
parent 9f1452c629
commit eb4271ee1d

View File

@ -776,7 +776,7 @@ int deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
windowBits = -windowBits; windowBits = -windowBits;
} }
if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED || if (memLevel < 1 || memLevel > MAX_MEM_LEVEL || method != Z_DEFLATED ||
windowBits < 8 || windowBits > 15 || level < 0 || level > 9 || windowBits < 9 || windowBits > 15 || level < 0 || level > 9 ||
strategy < 0 || strategy > Z_HUFFMAN_ONLY) { strategy < 0 || strategy > Z_HUFFMAN_ONLY) {
return Z_STREAM_ERROR; return Z_STREAM_ERROR;
} }