* Check that the match at match_start is indeed a match.
*/
void check_match(deflate_state *s, Pos start, Pos match, int length) {
+ /* check that the match length is valid*/
+ if (length < MIN_MATCH || length > MAX_MATCH) {
+ fprintf(stderr, " start %u, match %u, length %d\n", start, match, length);
+ z_error("invalid match length");
+ }
/* check that the match is indeed a match */
if (memcmp(s->window + match, s->window + start, length) != EQUAL) {
fprintf(stderr, " start %u, match %u, length %d\n", start, match, length);
if (match_len > s->lookahead)
match_len = s->lookahead;
- if (match_len > MAX_MATCH)
- match_len = MAX_MATCH;
-
check_match(s, s->strstart, hash_head, match_len);
zng_tr_emit_dist(s, static_ltree, static_dtree, match_len - MIN_MATCH, dist);