提交 1250ac74 编写于 作者: M Mark Adler

Add assertions to fill_window() in deflate.c to match comments.

上级 5cf0930b
...@@ -1322,6 +1322,8 @@ local void fill_window(s) ...@@ -1322,6 +1322,8 @@ local void fill_window(s)
unsigned more; /* Amount of free space at the end of the window. */ unsigned more; /* Amount of free space at the end of the window. */
uInt wsize = s->w_size; uInt wsize = s->w_size;
Assert(s->lookahead < MIN_LOOKAHEAD, "already enough lookahead");
do { do {
more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart); more = (unsigned)(s->window_size -(ulg)s->lookahead -(ulg)s->strstart);
...@@ -1439,6 +1441,9 @@ local void fill_window(s) ...@@ -1439,6 +1441,9 @@ local void fill_window(s)
s->high_water += init; s->high_water += init;
} }
} }
Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
"not enough room for search");
} }
/* =========================================================================== /* ===========================================================================
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册