mirror of
https://github.com/madler/zlib.git
synced 2026-10-24 02:48:53 +03:00
Honor deflateReset promise to reset the header.
This corrects the code to match the documentation in zlib.h. However, note that this may break code out there that assumed the incorrect persistence of the header across resets.
This commit is contained in:
committed by
Mark Adler
parent
ec63cd60eb
commit
767c4c9478
@@ -445,7 +445,6 @@ int ZEXPORT deflateInit2_(z_streamp strm, int level, int method,
|
||||
s->status = INIT_STATE; /* to pass state test in deflateReset() */
|
||||
|
||||
s->wrap = wrap;
|
||||
s->gzhead = Z_NULL;
|
||||
s->w_bits = (uInt)windowBits;
|
||||
s->w_size = 1 << s->w_bits;
|
||||
s->w_mask = s->w_size - 1;
|
||||
@@ -671,6 +670,8 @@ int ZEXPORT deflateResetKeep(z_streamp strm) {
|
||||
adler32(0L, Z_NULL, 0);
|
||||
s->last_flush = -2;
|
||||
|
||||
s->gzhead = Z_NULL;
|
||||
|
||||
_tr_init(s);
|
||||
|
||||
return Z_OK;
|
||||
|
||||
Reference in New Issue
Block a user