diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2012-01-14 10:53:23 -0800 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2012-01-14 10:53:23 -0800 |
commit | 68f64498c2bbabaef0180f4d30207db2b0b67f07 (patch) | |
tree | 0fee5f65e1e81faca9846b6be7a5685a3f79eac9 | |
parent | 4f5779a8e78e0b1c8b1ecdea88d8456dada17823 (diff) | |
download | zlib-68f64498c2bbabaef0180f4d30207db2b0b67f07.tar.gz zlib-68f64498c2bbabaef0180f4d30207db2b0b67f07.tar.bz2 zlib-68f64498c2bbabaef0180f4d30207db2b0b67f07.zip |
Make sure that no extra inserting is done if the strategy changes.
-rw-r--r-- | deflate.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -1606,6 +1606,7 @@ local block_state deflate_stored(s, flush) | |||
1606 | FLUSH_BLOCK(s, 0); | 1606 | FLUSH_BLOCK(s, 0); |
1607 | } | 1607 | } |
1608 | } | 1608 | } |
1609 | s->insert = 0; | ||
1609 | if (flush == Z_FINISH) { | 1610 | if (flush == Z_FINISH) { |
1610 | FLUSH_BLOCK(s, 1); | 1611 | FLUSH_BLOCK(s, 1); |
1611 | return finish_done; | 1612 | return finish_done; |
@@ -1914,6 +1915,7 @@ local block_state deflate_rle(s, flush) | |||
1914 | } | 1915 | } |
1915 | if (bflush) FLUSH_BLOCK(s, 0); | 1916 | if (bflush) FLUSH_BLOCK(s, 0); |
1916 | } | 1917 | } |
1918 | s->insert = 0; | ||
1917 | if (flush == Z_FINISH) { | 1919 | if (flush == Z_FINISH) { |
1918 | FLUSH_BLOCK(s, 1); | 1920 | FLUSH_BLOCK(s, 1); |
1919 | return finish_done; | 1921 | return finish_done; |
@@ -1952,6 +1954,7 @@ local block_state deflate_huff(s, flush) | |||
1952 | s->strstart++; | 1954 | s->strstart++; |
1953 | if (bflush) FLUSH_BLOCK(s, 0); | 1955 | if (bflush) FLUSH_BLOCK(s, 0); |
1954 | } | 1956 | } |
1957 | s->insert = 0; | ||
1955 | if (flush == Z_FINISH) { | 1958 | if (flush == Z_FINISH) { |
1956 | FLUSH_BLOCK(s, 1); | 1959 | FLUSH_BLOCK(s, 1); |
1957 | return finish_done; | 1960 | return finish_done; |