diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2017-01-15 08:22:16 -0800 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2017-01-15 09:29:40 -0800 |
commit | cbbd20302c6e3fb626bee5bd8b4932524049515c (patch) | |
tree | 91a632d17b1f7596af41e10537872ed02ee87d33 /deflate.c | |
parent | 7d9c9d410a7f8c732fdb0cac2b268659d624a6b6 (diff) | |
download | zlib-cbbd20302c6e3fb626bee5bd8b4932524049515c.tar.gz |
Permit immediate deflateParams changes before any deflate input.
This permits deflateParams to change the strategy and level right
after deflateInit, without having to wait until a header has been
written. The parameters can be changed immediately up until the
first deflate call that consumes any input data.
Diffstat (limited to 'deflate.c')
-rw-r--r-- | deflate.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -586,7 +586,8 @@ int ZEXPORT deflateParams(strm, level, strategy) } func = configuration_table[s->level].func; - if ((strategy != s->strategy || func != configuration_table[level].func)) { + if ((strategy != s->strategy || func != configuration_table[level].func) && + s->high_water) { /* Flush the last buffer: */ int err = deflate(strm, Z_BLOCK); if (err == Z_STREAM_ERROR) |