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 zlib-cbbd20302c6e3fb626bee5bd8b4932524049515c.tar.bz2 zlib-cbbd20302c6e3fb626bee5bd8b4932524049515c.zip |
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) | |||
586 | } | 586 | } |
587 | func = configuration_table[s->level].func; | 587 | func = configuration_table[s->level].func; |
588 | 588 | ||
589 | if ((strategy != s->strategy || func != configuration_table[level].func)) { | 589 | if ((strategy != s->strategy || func != configuration_table[level].func) && |
590 | s->high_water) { | ||
590 | /* Flush the last buffer: */ | 591 | /* Flush the last buffer: */ |
591 | int err = deflate(strm, Z_BLOCK); | 592 | int err = deflate(strm, Z_BLOCK); |
592 | if (err == Z_STREAM_ERROR) | 593 | if (err == Z_STREAM_ERROR) |