]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
try to consume available data if Z_FINISH is used
authorcielavenir <cielartisan@gmail.com>
Fri, 16 Aug 2019 16:59:38 +0000 (01:59 +0900)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 22 Aug 2019 10:46:21 +0000 (12:46 +0200)
arch/x86/deflate_quick.c

index 0c5196926b609c3feb4504294063859c8fbd7814..199ec73456ce8b809a50cb58f3039a91596f96e4 100644 (file)
@@ -230,7 +230,9 @@ ZLIB_INTERNAL block_state deflate_quick(deflate_state *s, int flush) {
     do {
         if (s->pending + 4 >= s->pending_buf_size) {
             flush_pending(s->strm);
-            return need_more;
+            if (flush != Z_FINISH) {
+                return need_more;
+            }
         }
 
         if (s->lookahead < MIN_LOOKAHEAD) {