]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Fix #1861: Restrict overlapLog Parameter When Not Built With Multithreading 1873/head
authorW. Felix Handte <w@felixhandte.com>
Wed, 6 Nov 2019 21:05:02 +0000 (16:05 -0500)
committerW. Felix Handte <w@felixhandte.com>
Wed, 6 Nov 2019 21:05:02 +0000 (16:05 -0500)
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.

lib/compress/zstd_compress.c

index 35346b92cb1afaf3f02c4b9fab07915521949dbc..edeac4b950225be1195226b1182aa0693ed31d11 100644 (file)
@@ -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: