From: Yann Collet Date: Sat, 1 Jun 2019 00:06:28 +0000 (-0700) Subject: fixed wrong assert in double_fast X-Git-Tag: v1.4.1^2~24^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fce4df3ab7be85a8c3bd3ef8e604c329b6864b18;p=thirdparty%2Fzstd.git fixed wrong assert in double_fast --- diff --git a/lib/compress/zstd_double_fast.c b/lib/compress/zstd_double_fast.c index 7bc2e3fa0..3c8e22ba5 100644 --- a/lib/compress/zstd_double_fast.c +++ b/lib/compress/zstd_double_fast.c @@ -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);