From: Yann Collet Date: Tue, 17 Apr 2018 23:18:37 +0000 (-0700) Subject: fix dictDelta setting error X-Git-Tag: upstream/1.9.3~8^2~33^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=88cca1723e76c8f5031954ba07b28447c0cb55d8;p=platform%2Fupstream%2Flz4.git fix dictDelta setting error wrong test --- diff --git a/lib/lz4.c b/lib/lz4.c index c799596..e7553ed 100644 --- a/lib/lz4.c +++ b/lib/lz4.c @@ -637,7 +637,7 @@ LZ4_FORCE_INLINE int LZ4_compress_generic( dictDirective == usingDictCtx ? dictCtx->dictionary : cctx->dictionary; const U32 dictSize = dictDirective == usingDictCtx ? dictCtx->dictSize : cctx->dictSize; - const U32 dictDelta = usingDictCtx ? startIndex - dictCtx->currentOffset : 0; /* make indexes in dictCtx comparable with index in current context */ + const U32 dictDelta = (dictDirective == usingDictCtx) ? startIndex - dictCtx->currentOffset : 0; /* make indexes in dictCtx comparable with index in current context */ int const maybe_extMem = (dictDirective == usingExtDict) || (dictDirective == usingDictCtx); U32 const prefixIdxLimit = startIndex - dictSize; /* used when dictDirective == dictSmall */