[PATCH 4/8] lib/zlib: Fix DFLTCC ignoring flush modes when avail_in == 0
From: Mikhail Zaslonko
Date: Thu Jan 26 2023 - 08:16:57 EST
This commit is based on:
https://github.com/zlib-ng/zlib-ng/commit/40acb3f
Signed-off-by: Mikhail Zaslonko <zaslonko@xxxxxxxxxxxxx>
Acked-by: Ilya Leoshkevich <iii@xxxxxxxxxxxxx>
---
lib/zlib_dfltcc/dfltcc_deflate.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/zlib_dfltcc/dfltcc_deflate.c b/lib/zlib_dfltcc/dfltcc_deflate.c
index dc85ec890163..211d344710d5 100644
--- a/lib/zlib_dfltcc/dfltcc_deflate.c
+++ b/lib/zlib_dfltcc/dfltcc_deflate.c
@@ -142,7 +142,8 @@ int dfltcc_deflate(
/* Clear history. */
if (flush == Z_FULL_FLUSH)
param->hl = 0;
- *result = need_more;
+ /* Trigger block post-processing if necessary. */
+ *result = no_flush ? need_more : block_done;
return 1;
}
--
2.34.1