diff options
Diffstat (limited to 'deflate.c')
-rw-r--r-- | deflate.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1761,11 +1761,11 @@ local block_state deflate_rle(s, flush) | |||
1761 | for (;;) { | 1761 | for (;;) { |
1762 | /* Make sure that we always have enough lookahead, except | 1762 | /* Make sure that we always have enough lookahead, except |
1763 | * at the end of the input file. We need MAX_MATCH bytes | 1763 | * at the end of the input file. We need MAX_MATCH bytes |
1764 | * for the longest encodable run. | 1764 | * for the longest run, plus one for the unrolled loop. |
1765 | */ | 1765 | */ |
1766 | if (s->lookahead < MAX_MATCH) { | 1766 | if (s->lookahead <= MAX_MATCH) { |
1767 | fill_window(s); | 1767 | fill_window(s); |
1768 | if (s->lookahead < MAX_MATCH && flush == Z_NO_FLUSH) { | 1768 | if (s->lookahead <= MAX_MATCH && flush == Z_NO_FLUSH) { |
1769 | return need_more; | 1769 | return need_more; |
1770 | } | 1770 | } |
1771 | if (s->lookahead == 0) break; /* flush the current block */ | 1771 | if (s->lookahead == 0) break; /* flush the current block */ |
@@ -1788,6 +1788,7 @@ local block_state deflate_rle(s, flush) | |||
1788 | if (s->match_length > s->lookahead) | 1788 | if (s->match_length > s->lookahead) |
1789 | s->match_length = s->lookahead; | 1789 | s->match_length = s->lookahead; |
1790 | } | 1790 | } |
1791 | Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan"); | ||
1791 | } | 1792 | } |
1792 | 1793 | ||
1793 | /* Emit match if have run of MIN_MATCH or longer, else emit literal */ | 1794 | /* Emit match if have run of MIN_MATCH or longer, else emit literal */ |