From 25a8b18c5d392692ad56cea830d0d7c220b397af Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Fri, 10 Jun 2022 16:55:08 +0300 Subject: [PATCH] Update high water mark in deflate_stored. https://github.com/madler/zlib/commit/7d9c9d410a7f8c732fdb0cac2b268659d624a6b6 --- lib/zlib/deflate.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/zlib/deflate.js b/lib/zlib/deflate.js index 0c5fc1c..fe5f7c9 100644 --- a/lib/zlib/deflate.js +++ b/lib/zlib/deflate.js @@ -609,6 +609,9 @@ const deflate_stored = (s, flush) => { s.block_start = s.strstart; s.insert += used > s.w_size - s.insert ? s.w_size - s.insert : used; } + if (s.high_water < s.strstart) { + s.high_water = s.strstart; + } /* If the last block was written to next_out, then done. */ if (last) { @@ -641,6 +644,9 @@ const deflate_stored = (s, flush) => { read_buf(s.strm, s.window, s.strstart, have); s.strstart += have; } + if (s.high_water < s.strstart) { + s.high_water = s.strstart; + } /* There was not enough avail_out to write a complete worthy or flushed * stored block to next_out. Write a stored block to pending instead, if we