diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-22 23:55:31 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-22 23:55:31 -0700 |
commit | 1250ac745d9c826f8bed79dc790ae4256b6dbfab (patch) | |
tree | b2977ec6324aa6f71da27827295729c341dc7b70 /deflate.c | |
parent | 5cf0930ba5cea55fc688151c9b718110b2c6adfd (diff) | |
download | zlib-1250ac745d9c826f8bed79dc790ae4256b6dbfab.tar.gz |
Add assertions to fill_window() in deflate.c to match comments.
Diffstat (limited to 'deflate.c')
-rw-r--r-- | deflate.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1322,6 +1322,8 @@ local void fill_window(s) unsigned more; /* Amount of free space at the end of the window. */ uInt wsize = s->w_size; + Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); + do { more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); @@ -1439,6 +1441,9 @@ local void fill_window(s) s->high_water += init; } } + + Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, + "not enough room for search"); } /* =========================================================================== |