]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
[libzstd] Set CLEVEL_CUSTOM correctly 879/head
authorNick Terrell <terrelln@fb.com>
Mon, 2 Oct 2017 20:43:30 +0000 (13:43 -0700)
committerNick Terrell <terrelln@fb.com>
Mon, 2 Oct 2017 20:43:30 +0000 (13:43 -0700)
In `ZSTD_compressBegin_advanced()`, `ZSTD_parameters` are used to set the
compression parameters, but the level didn't get set to `CLEVEL_CUSTOM`, so
`ZSTD_compressBlock()` used the wrong parameters when checking the source
size.

lib/compress/zstd_compress.c

index 892912f2e043b34a9df0cb17deb4c7309094468c..35aede3c429ea25020c84908a4c573883b7bbffd 100644 (file)
@@ -240,6 +240,7 @@ static ZSTD_CCtx_params ZSTD_assignParamsToCCtxParams(
     ZSTD_CCtx_params ret = cctxParams;
     ret.cParams = params.cParams;
     ret.fParams = params.fParams;
+    ret.compressionLevel = ZSTD_CLEVEL_CUSTOM;
     return ret;
 }