]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fix compression bug in rollbuffer mode
authorYann Collet <yann.collet.73@gmail.com>
Tue, 17 Nov 2015 15:14:55 +0000 (16:14 +0100)
committerYann Collet <yann.collet.73@gmail.com>
Tue, 17 Nov 2015 15:14:55 +0000 (16:14 +0100)
lib/zstd_compress.c

index ad3db50c5ad5ad62485d4907da9576873dd5602b..53dfc742ff71906a46e315f08a32a699b8ab583e 100644 (file)
@@ -867,7 +867,7 @@ size_t ZSTD_compressBlock_fast_extDict_generic(ZSTD_CCtx* ctx,
             const BYTE* iEndCount = (matchEnd - match < iend - ip) ? ip + (matchEnd - match) : iend;
             size_t matchLength = ZSTD_count(ip+MINMATCH, match+MINMATCH, iEndCount);
             size_t offsetCode = current-matchIndex;
-            if (matchIndex + matchLength + MINMATCH == dictLimit)
+            if (match + matchLength + MINMATCH == matchEnd)
                 matchLength += ZSTD_count(ip + matchLength + MINMATCH, base + dictLimit, iend);
             if (offsetCode == offset_2) offsetCode = 0;
             offset_2 = offset_1;