From: Nick Terrell Date: Wed, 17 Jul 2019 18:07:24 +0000 (-0700) Subject: [LZ4_compress_destSize] Allow 2 more bytes of match length X-Git-Tag: upstream/1.9.3~2^2~11^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=690009e2c2f9e5dcb0d40e7c0c40610ce6006eda;p=platform%2Fupstream%2Flz4.git [LZ4_compress_destSize] Allow 2 more bytes of match length --- diff --git a/lib/lz4.c b/lib/lz4.c index 5b03e3d..1e80c98 100644 --- a/lib/lz4.c +++ b/lib/lz4.c @@ -1016,7 +1016,7 @@ _next_match: (unlikely(op + (1 + LASTLITERALS) + (matchCode>>8) > olimit)) ) { if (outputDirective == fillOutput) { /* Match description too long : reduce it */ - U32 newMatchCode = 15 /* in token */ - 1 /* to avoid needing a zero byte */ + ((U32)(olimit - op) - 2 - 1 - LASTLITERALS) * 255; + U32 newMatchCode = 15 /* in token */ - 1 /* to avoid needing a zero byte */ + ((U32)(olimit - op) - 1 - LASTLITERALS) * 255; ip -= matchCode - newMatchCode; matchCode = newMatchCode; } else {