diff --git a/lib/deflate_compress.c b/lib/deflate_compress.c index eea49bd..fe6b9b5 100644 --- a/lib/deflate_compress.c +++ b/lib/deflate_compress.c @@ -2122,7 +2122,9 @@ deflate_compress_lazy(struct libdeflate_compressor * restrict c, c->max_search_depth, next_hashes, &cur_offset); - if (cur_len < DEFLATE_MIN_MATCH_LEN) { + if (cur_len < DEFLATE_MIN_MATCH_LEN || + (cur_len == DEFLATE_MIN_MATCH_LEN && + cur_offset > 8192)) { /* No match found. Choose a literal. */ deflate_choose_literal(c, *in_next, &litrunlen); observe_literal(&c->split_stats, *in_next);