]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
zstd_opt.h: fixed checking of rep codes (2) 264/head
authorinikep <inikep@gmail.com>
Fri, 29 Jul 2016 14:45:39 +0000 (16:45 +0200)
committerinikep <inikep@gmail.com>
Fri, 29 Jul 2016 14:45:39 +0000 (16:45 +0200)
lib/compress/zstd_opt.h

index 387d62400f92759de37bd044b96450c2cf627b62..9496ed358851dd891b4f232ee9fd143b2464b36b 100644 (file)
@@ -885,7 +885,7 @@ void ZSTD_compressBlock_opt_extDict_generic(ZSTD_CCtx* ctx,
                     const U32 repIndex = (U32)(current+cur - opt[cur].rep[i]);
                     const BYTE* const repBase = repIndex < dictLimit ? dictBase : base;
                     const BYTE* const repMatch = repBase + repIndex;
-                    if ((rep[i]<(U32)(ip-prefixStart))
+                    if ((opt[cur].rep[i]<(U32)(ip-prefixStart))
                       && (((U32)((dictLimit-1) - repIndex) >= 3) & (repIndex>lowestIndex))  /* intentional overflow */
                       && (MEM_readMINMATCH(inr, minMatch) == MEM_readMINMATCH(repMatch, minMatch)) ) {
                         /* repcode detected */