X-Git-Url: https://wimlib.net/git/?p=wimlib;a=blobdiff_plain;f=src%2Flzx-compress.c;h=c7ff96f51d0e062a43b3a15753c95446a5012f35;hp=a9745b62c8a74973114e1088a358468d1123d8cc;hb=82b8e9da4931a731976c3998f2464d4e690502e8;hpb=93110bb18090d4d2c00294a56f819c7edeef318f diff --git a/src/lzx-compress.c b/src/lzx-compress.c index a9745b62..c7ff96f5 100644 --- a/src/lzx-compress.c +++ b/src/lzx-compress.c @@ -1788,6 +1788,8 @@ lzx_choose_lazy_items_for_block(struct lzx_compressor *c, * length 3 match. Output the previous match if there * is one; otherwise output a literal. */ + no_match_found: + if (prev_len) { skip_len = prev_len - 2; goto output_prev_match; @@ -1825,11 +1827,8 @@ lzx_choose_lazy_items_for_block(struct lzx_compressor *c, if (unlikely(cur_len > block_end - (window_ptr - 1))) { /* Nearing end of block. */ cur_len = block_end - (window_ptr - 1); - if (cur_len < 3) { - lzx_declare_literal(c, *(window_ptr - 1), &next_chosen_item); - prev_len = 0; - continue; - } + if (cur_len < 3) + goto no_match_found; } if (prev_len == 0 || cur_score > prev_score) {