From 8a1cdad62bd31f2aac4824ff2a7b1d4da3f36e85 Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Fri, 10 Jun 2022 17:12:14 +0300 Subject: [PATCH] Fix deflateEnd() to not report an error at start of raw deflate. https://github.com/madler/zlib/commit/c376a417a724c21173f40765bd643388523b16f7 --- lib/zlib/deflate.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/zlib/deflate.js b/lib/zlib/deflate.js index b932d31..7165d02 100644 --- a/lib/zlib/deflate.js +++ b/lib/zlib/deflate.js @@ -1589,6 +1589,9 @@ const deflate = (strm, flush) => { } /* Write the header */ + if (s.status === INIT_STATE && s.wrap === 0) { + s.status = BUSY_STATE; + } if (s.status === INIT_STATE) { /* zlib header */ let header = (Z_DEFLATED + ((s.w_bits - 8) << 4)) << 8;