]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Fixed zstd_opt encoding error with repeat-offsets
authorYann Collet <yann.collet.73@gmail.com>
Thu, 16 Jun 2016 11:20:46 +0000 (13:20 +0200)
committerYann Collet <yann.collet.73@gmail.com>
Thu, 16 Jun 2016 11:20:46 +0000 (13:20 +0200)
lib/compress/zstd_opt.h

index 703b568e2ab256befa0df5395c91877a095a488a..8b15bf6adf7f245d5ad7725d530256c01039e861 100644 (file)
@@ -574,7 +574,7 @@ void ZSTD_compressBlock_opt_generic(ZSTD_CCtx* ctx,
            best_mlen = minMatch;
            {   U32 i;
                for (i=0; i<ZSTD_REP_NUM; i++) {
-                   if ((rep[i]<(U32)(inr-prefixStart))
+                   if ((opt[cur].rep[i]<(U32)(inr-prefixStart))
                        && (MEM_readMINMATCH(inr, minMatch) == MEM_readMINMATCH(inr - opt[cur].rep[i], minMatch))) {  /* check rep */
                        mlen = (U32)ZSTD_count(inr+minMatch, inr+minMatch - opt[cur].rep[i], iend) + minMatch;
                        ZSTD_LOG_PARSER("%d: Found REP %d/%d mlen=%d off=%d rep=%d opt[%d].off=%d\n", (int)(inr-base), i, ZSTD_REP_NUM, mlen, i, opt[cur].rep[i], cur, opt[cur].off);