aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-22 23:55:31 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-22 23:55:31 -0700
commit1250ac745d9c826f8bed79dc790ae4256b6dbfab (patch)
treeb2977ec6324aa6f71da27827295729c341dc7b70
parent5cf0930ba5cea55fc688151c9b718110b2c6adfd (diff)
downloadzlib-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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/deflate.c b/deflate.c
index 06ca0ee..b126a71 100644
--- a/deflate.c
+++ b/deflate.c
@@ -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/* ===========================================================================