Merge pull request #2819 from terrelln/ldm-hash-rate-log

[ldm] Fix ZSTD_c_ldmHashRateLog bounds check
This commit is contained in:
Nick Terrell 2021-10-08 14:58:29 -07:00 committed by GitHub
commit 26486db9ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -866,8 +866,8 @@ size_t ZSTD_CCtxParams_setParameter(ZSTD_CCtx_params* CCtxParams,
return CCtxParams->ldmParams.bucketSizeLog;
case ZSTD_c_ldmHashRateLog :
RETURN_ERROR_IF(value > ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN,
parameter_outOfBound, "Param out of bounds!");
if (value!=0) /* 0 ==> default */
BOUNDCHECK(ZSTD_c_ldmHashRateLog, value);
CCtxParams->ldmParams.hashRateLog = value;
return CCtxParams->ldmParams.hashRateLog;