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