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.
This commit is contained in:
Mark Adler 2016-12-03 08:29:57 -08:00
parent 123f9cfaf7
commit c5ee34c28a

View File

@ -554,7 +554,7 @@ int ZEXPORT gzsetparams(file, level, strategy)
/* change compression parameters for subsequent input */
if (state->size) {
/* flush previous input with previous parameters before changing */
if (strm->avail_in && gz_comp(state, Z_PARTIAL_FLUSH) == -1)
if (strm->avail_in && gz_comp(state, Z_BLOCK) == -1)
return state->err;
deflateParams(strm, level, strategy);
}