insert_match(s, current_match);
/* now, look ahead one */
- if (s->lookahead > MIN_LOOKAHEAD) {
+ if (s->lookahead > MIN_LOOKAHEAD && (current_match.strstart + current_match.match_length) < (s->window_size - MIN_LOOKAHEAD)) {
s->strstart = current_match.strstart + current_match.match_length;
hash_head = insert_string(s, s->strstart, 1);
Assert((unsigned long)s->strstart <= s->window_size - MIN_LOOKAHEAD, "need lookahead");
do {
- Assert(cur_match < s->strstart, "no future");
+ if (cur_match >= s->strstart) {
+ break;
+ }
match = s->window + cur_match;
/*
Assert((unsigned long)s->strstart <= s->window_size - MIN_LOOKAHEAD, "need lookahead");
do {
unsigned char *match;
- Assert(cur_match < s->strstart, "no future");
+ if (cur_match >= s->strstart) {
+ break;
+ }
match = s->window + cur_match;
/*
Assert((unsigned long)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
do {
- Assert(cur_match < s->strstart, "no future");
+ if (cur_match >= s->strstart) {
+ break;
+ }
/* Skip to next match if the match length cannot increase
* or if the match length is less than 2. Note that the checks below