]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
fix bug #225: account bits sent
authorSebastian Pop <s.pop@samsung.com>
Thu, 17 Jan 2019 18:26:30 +0000 (12:26 -0600)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 24 Jan 2019 11:42:46 +0000 (12:42 +0100)
arch/x86/deflate_quick.c

index 3f88736eb191f0e33d00a4fc399798340c9997c3..9fb321d1ece7825e855536298b2c85ebc00a6150 100644 (file)
@@ -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)