aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2012-01-14 10:53:23 -0800
committerMark Adler <madler@alumni.caltech.edu>2012-01-14 10:53:23 -0800
commit68f64498c2bbabaef0180f4d30207db2b0b67f07 (patch)
tree0fee5f65e1e81faca9846b6be7a5685a3f79eac9
parent4f5779a8e78e0b1c8b1ecdea88d8456dada17823 (diff)
downloadzlib-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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/deflate.c b/deflate.c
index 0ba984d..98c4d6e 100644
--- a/deflate.c
+++ b/deflate.c
@@ -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;