From 86e83e926f1d8c03447865b340fc6126093eb517 Mon Sep 17 00:00:00 2001 From: Nick Terrell Date: Mon, 2 Oct 2017 13:43:30 -0700 Subject: [PATCH] [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. --- lib/compress/zstd_compress.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index 892912f2..35aede3c 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; }