From: Sebastian Pop Date: Thu, 17 Jan 2019 18:26:30 +0000 (-0600) Subject: fix bug #225: account bits sent X-Git-Tag: 1.9.9-b1~537 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c18edd810cbb16b3fe6751e3d8b4e8e00337eeeb;p=thirdparty%2Fzlib-ng.git fix bug #225: account bits sent --- diff --git a/arch/x86/deflate_quick.c b/arch/x86/deflate_quick.c index 3f88736eb..9fb321d1e 100644 --- a/arch/x86/deflate_quick.c +++ b/arch/x86/deflate_quick.c @@ -177,10 +177,16 @@ static void static_emit_tree(deflate_state *const s, const int flush) { last = flush == Z_FINISH ? 1 : 0; Tracev((stderr, "\n--- Emit Tree: Last: %u\n", last)); send_bits(s, (STATIC_TREES << 1)+ last, 3); +#ifdef ZLIB_DEBUG + s->compressed_len += 3; +#endif } static void static_emit_end_block(deflate_state *const s, int last) { send_code(s, END_BLOCK, static_ltree); +#ifdef ZLIB_DEBUG + s->compressed_len += 7; /* 7 bits for EOB */ +#endif Tracev((stderr, "\n+++ Emit End Block: Last: %u Pending: %u Total Out: %zu\n", last, s->pending, s->strm->total_out)); if (last)