From: Mark Adler Date: Sat, 3 Dec 2016 16:29:57 +0000 (-0800) Subject: Don't need to emit an empty fixed block when changing parameters. X-Git-Tag: 1.9.9-b1~719 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fbe9792d3d5e87c33dacb4cc52d57ec0f8de3d6;p=thirdparty%2Fzlib-ng.git 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. --- diff --git a/gzwrite.c b/gzwrite.c index 2aaf4d52c..43b2c0a3a 100644 --- a/gzwrite.c +++ b/gzwrite.c @@ -409,7 +409,7 @@ int ZEXPORT gzsetparams(gzFile file, int level, int 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); }