fix window resizing edge case

This commit is contained in:
Danielle Rozenblit
2022-12-13 08:35:20 -08:00
parent dc39409a03
commit 69ec75f0d5
+2 -2
View File
@@ -1370,8 +1370,8 @@ ZSTD_adjustCParams_internal(ZSTD_compressionParameters cPar,
} }
/* resize windowLog if input is small enough, to use less memory */ /* resize windowLog if input is small enough, to use less memory */
if ( (srcSize < maxWindowResize) if ( (srcSize <= maxWindowResize)
&& (dictSize < maxWindowResize) ) { && (dictSize <= maxWindowResize) ) {
U32 const tSize = (U32)(srcSize + dictSize); U32 const tSize = (U32)(srcSize + dictSize);
static U32 const hashSizeMin = 1 << ZSTD_HASHLOG_MIN; static U32 const hashSizeMin = 1 << ZSTD_HASHLOG_MIN;
U32 const srcLog = (tSize < hashSizeMin) ? ZSTD_HASHLOG_MIN : U32 const srcLog = (tSize < hashSizeMin) ? ZSTD_HASHLOG_MIN :