diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2016-12-03 08:29:57 -0800 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2016-12-04 07:48:47 -0800 |
commit | c5ee34c28a9144b1b5a5021d05ed29940c53010c (patch) | |
tree | 2b524d836c87f3693a60fd5a33a361d04f1f66f1 | |
parent | 123f9cfaf7730dcc52c380eaf04c15dc3e0b15f8 (diff) | |
download | zlib-c5ee34c28a9144b1b5a5021d05ed29940c53010c.tar.gz zlib-c5ee34c28a9144b1b5a5021d05ed29940c53010c.tar.bz2 zlib-c5ee34c28a9144b1b5a5021d05ed29940c53010c.zip |
Don't need to emit an empty fixed block when changing parameters.
gzsetparams() was using Z_PARTIAL_FLUSH when it could use Z_BLOCK
instead. This commit uses Z_BLOCK, which avoids emitting an
unnecessary ten bits into the stream.
-rw-r--r-- | gzwrite.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -554,7 +554,7 @@ int ZEXPORT gzsetparams(file, level, strategy) | |||
554 | /* change compression parameters for subsequent input */ | 554 | /* change compression parameters for subsequent input */ |
555 | if (state->size) { | 555 | if (state->size) { |
556 | /* flush previous input with previous parameters before changing */ | 556 | /* flush previous input with previous parameters before changing */ |
557 | if (strm->avail_in && gz_comp(state, Z_PARTIAL_FLUSH) == -1) | 557 | if (strm->avail_in && gz_comp(state, Z_BLOCK) == -1) |
558 | return state->err; | 558 | return state->err; |
559 | deflateParams(strm, level, strategy); | 559 | deflateParams(strm, level, strategy); |
560 | } | 560 | } |