From c5ee34c28a9144b1b5a5021d05ed29940c53010c Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Sat, 3 Dec 2016 08:29:57 -0800 Subject: [PATCH] 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. --- gzwrite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gzwrite.c b/gzwrite.c index 2905cceb..61a4de7c 100644 --- a/gzwrite.c +++ b/gzwrite.c @@ -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); }