]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
limit zlib compression level to Z_BEST_COMPRESSION
authorPrzemyslaw Skibinski <inikep@gmail.com>
Mon, 13 Feb 2017 20:00:41 +0000 (21:00 +0100)
committerPrzemyslaw Skibinski <inikep@gmail.com>
Mon, 13 Feb 2017 20:00:41 +0000 (21:00 +0100)
programs/fileio.c

index 430127771ea4cfc009b02f34c236bfaf35e4b8cc..9f1560b4334ba9053e393693c952334024df7d01 100644 (file)
@@ -344,6 +344,8 @@ static unsigned long long FIO_compressGzFrame(cRess_t* ress, const char* srcFile
     z_stream strm;
     int ret;
 
+    if (compressionLevel > Z_BEST_COMPRESSION) compressionLevel = Z_BEST_COMPRESSION;
+
     strm.zalloc = Z_NULL;
     strm.zfree = Z_NULL;
     strm.opaque = Z_NULL;