Fix gzwrite.c to accommodate reduced memory zlib compilation.

gzwrite.c had hard-coded parameters to deflateInit2() which could
contradict compile-time options for the use of less memory and fewer
code bits.  This patch suggested by Karsten Saunte fixes that.
This commit is contained in:
Mark Adler
2011-12-08 10:16:31 -08:00
parent afe7cf78d5
commit fb00fda903
2 changed files with 8 additions and 1 deletions

View File

@@ -40,7 +40,7 @@ local int gz_init(state)
strm->zfree = Z_NULL;
strm->opaque = Z_NULL;
ret = deflateInit2(strm, state->level, Z_DEFLATED,
15 + 16, 8, state->strategy);
MAX_WBITS + 16, DEF_MEM_LEVEL, state->strategy);
if (ret != Z_OK) {
free(state->out);
free(state->in);