]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fixed wrong assert in double_fast
authorYann Collet <cyan@fb.com>
Sat, 1 Jun 2019 00:06:28 +0000 (17:06 -0700)
committerYann Collet <cyan@fb.com>
Sat, 1 Jun 2019 00:06:28 +0000 (17:06 -0700)
lib/compress/zstd_double_fast.c

index 7bc2e3fa0db68bf3c2934f641f58cb1df6abb39f..3c8e22ba598760a3ed73d2a2956b3f6a2283ccd9 100644 (file)
@@ -97,11 +97,14 @@ size_t ZSTD_compressBlock_doubleFast_generic(
                                      dictCParams->chainLog : hBitsS;
     const U32 dictAndPrefixLength  = (U32)(ip - prefixLowest + dictEnd - dictStart);
 
+    DEBUGLOG(5, "ZSTD_compressBlock_doubleFast_generic");
+
     assert(dictMode == ZSTD_noDict || dictMode == ZSTD_dictMatchState);
 
     /* if a dictionary is attached, it must be within window range */
-    if (dictMode == ZSTD_dictMatchState)
-        assert(lowestValid + maxDistance <= endIndex);
+    if (dictMode == ZSTD_dictMatchState) {
+        assert(lowestValid + maxDistance >= endIndex);
+    }
 
     /* init */
     ip += (dictAndPrefixLength == 0);