From: Danielle Rozenblit Date: Tue, 13 Dec 2022 16:35:20 +0000 (-0800) Subject: fix window resizing edge case X-Git-Tag: v1.5.4^2~121^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69ec75f0d5e028aa34b3b51f990f38a18a0b7783;p=thirdparty%2Fzstd.git fix window resizing edge case --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 5bc7a9f3f..0069a7b1b 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -1370,8 +1370,8 @@ ZSTD_adjustCParams_internal(ZSTD_compressionParameters cPar, } /* resize windowLog if input is small enough, to use less memory */ - if ( (srcSize < maxWindowResize) - && (dictSize < maxWindowResize) ) { + if ( (srcSize <= maxWindowResize) + && (dictSize <= maxWindowResize) ) { U32 const tSize = (U32)(srcSize + dictSize); static U32 const hashSizeMin = 1 << ZSTD_HASHLOG_MIN; U32 const srcLog = (tSize < hashSizeMin) ? ZSTD_HASHLOG_MIN :