Skip to content

Commit

Permalink
fix fuzz issue 5131069967892480
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyan4973 committed Feb 9, 2024
1 parent 695d154 commit b0e8580
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/compress/zstd_opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1216,6 +1216,7 @@ ZSTD_compressBlock_opt_generic(ZSTD_matchState_t* ms,
if ( (optLevel >= 1) /* additional check only for higher modes */
&& (prevMatch.litlen == 0) /* replace a match */
&& (LL_INCPRICE(1) < 0) /* ll1 is cheaper than ll0 */
&& LIKELY(ip + cur < iend)
) {
/* check next position, in case it would be cheaper */
int with1literal = prevMatch.price + LIT_PRICE(ip+cur) + LL_INCPRICE(1);
Expand Down

0 comments on commit b0e8580

Please sign in to comment.