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:
parent
afe7cf78d5
commit
fb00fda903
7
gzguts.h
7
gzguts.h
@ -117,6 +117,13 @@
|
|||||||
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* default memLevel */
|
||||||
|
#if MAX_MEM_LEVEL >= 8
|
||||||
|
# define DEF_MEM_LEVEL 8
|
||||||
|
#else
|
||||||
|
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
|
||||||
|
#endif
|
||||||
|
|
||||||
/* default i/o buffer size -- double this for output when reading */
|
/* default i/o buffer size -- double this for output when reading */
|
||||||
#define GZBUFSIZE 8192
|
#define GZBUFSIZE 8192
|
||||||
|
|
||||||
|
@ -40,7 +40,7 @@ local int gz_init(state)
|
|||||||
strm->zfree = Z_NULL;
|
strm->zfree = Z_NULL;
|
||||||
strm->opaque = Z_NULL;
|
strm->opaque = Z_NULL;
|
||||||
ret = deflateInit2(strm, state->level, Z_DEFLATED,
|
ret = deflateInit2(strm, state->level, Z_DEFLATED,
|
||||||
15 + 16, 8, state->strategy);
|
MAX_WBITS + 16, DEF_MEM_LEVEL, state->strategy);
|
||||||
if (ret != Z_OK) {
|
if (ret != Z_OK) {
|
||||||
free(state->out);
|
free(state->out);
|
||||||
free(state->in);
|
free(state->in);
|
||||||
|
Loading…
Reference in New Issue
Block a user