From: Nick Terrell Date: Mon, 2 Oct 2017 20:43:30 +0000 (-0700) Subject: [libzstd] Set CLEVEL_CUSTOM correctly X-Git-Tag: v1.3.2~3^2~4^2~1^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F879%2Fhead;p=thirdparty%2Fzstd.git [libzstd] Set CLEVEL_CUSTOM correctly 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. --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 892912f2e..35aede3c4 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -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; }