From: W. Felix Handte Date: Wed, 6 Nov 2019 21:05:02 +0000 (-0500) Subject: Fix #1861: Restrict overlapLog Parameter When Not Built With Multithreading X-Git-Tag: v1.4.5^2~162^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c13f81905a3241dcef5ec9273eb5dfb326e83beb;p=thirdparty%2Fzstd.git Fix #1861: Restrict overlapLog Parameter When Not Built With Multithreading This parameter is unused in single-threaded compression. We should make it behave like the other multithread-only parameters, for which we only accept zero when we are not built with multithreading. --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 35346b92c..edeac4b95 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -339,8 +339,13 @@ ZSTD_bounds ZSTD_cParam_getBounds(ZSTD_cParameter param) return bounds; case ZSTD_c_overlapLog: +#ifdef ZSTD_MULTITHREAD bounds.lowerBound = ZSTD_OVERLAPLOG_MIN; bounds.upperBound = ZSTD_OVERLAPLOG_MAX; +#else + bounds.lowerBound = 0; + bounds.upperBound = 0; +#endif return bounds; case ZSTD_c_enableLongDistanceMatching: