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 | |
| parent | 5cf0930ba5cea55fc688151c9b718110b2c6adfd (diff) | |
| download | zlib-1250ac745d9c826f8bed79dc790ae4256b6dbfab.tar.gz zlib-1250ac745d9c826f8bed79dc790ae4256b6dbfab.tar.bz2 zlib-1250ac745d9c826f8bed79dc790ae4256b6dbfab.zip | |
Add assertions to fill_window() in deflate.c to match comments.
| -rw-r--r-- | deflate.c | 5 |
1 files changed, 5 insertions, 0 deletions
| @@ -1322,6 +1322,8 @@ local void fill_window(s) | |||
| 1322 | unsigned more; /* Amount of free space at the end of the window. */ | 1322 | unsigned more; /* Amount of free space at the end of the window. */ |
| 1323 | uInt wsize = s->w_size; | 1323 | uInt wsize = s->w_size; |
| 1324 | 1324 | ||
| 1325 | Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead"); | ||
| 1326 | |||
| 1325 | do { | 1327 | do { |
| 1326 | more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); | 1328 | more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); |
| 1327 | 1329 | ||
| @@ -1439,6 +1441,9 @@ local void fill_window(s) | |||
| 1439 | s->high_water += init; | 1441 | s->high_water += init; |
| 1440 | } | 1442 | } |
| 1441 | } | 1443 | } |
| 1444 | |||
| 1445 | Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD, | ||
| 1446 | "not enough room for search"); | ||
| 1442 | } | 1447 | } |
| 1443 | 1448 | ||
| 1444 | /* =========================================================================== | 1449 | /* =========================================================================== |
