]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Modify params rather than cctx->requestedParams
authorsenhuang42 <senhuang96@fb.com>
Fri, 11 Sep 2020 15:41:10 +0000 (11:41 -0400)
committersenhuang42 <senhuang96@fb.com>
Fri, 11 Sep 2020 15:41:10 +0000 (11:41 -0400)
lib/compress/zstd_compress.c

index 3283ce943c450e0456e90f63a1e158362cffccfa..e67e6b194ff84e9dcd7427839e1ff2fe64cdcbc6 100644 (file)
@@ -3993,11 +3993,10 @@ size_t ZSTD_compressStream2( ZSTD_CCtx* cctx,
         ZSTD_memset(&cctx->prefixDict, 0, sizeof(cctx->prefixDict));   /* single usage */
         assert(prefixDict.dict==NULL || cctx->cdict==NULL);    /* only one can be set */
         if (cctx->cdict)
-            cctx->requestedParams.compressionLevel = cctx->cdict->compressionLevel; /* let cdict take priority in terms of compression level */
+            params.compressionLevel = cctx->cdict->compressionLevel; /* let cdict take priority in terms of compression level */
         DEBUGLOG(4, "ZSTD_compressStream2 : transparent init stage");
         if (endOp == ZSTD_e_end) cctx->pledgedSrcSizePlusOne = input->size + 1;  /* auto-fix pledgedSrcSize */
-        params.cParams = ZSTD_getCParamsFromCCtxParams(
-                &cctx->requestedParams, cctx->pledgedSrcSizePlusOne-1, 0 /*dictSize*/);
+        params.cParams = ZSTD_getCParamsFromCCtxParams(&params, cctx->pledgedSrcSizePlusOne-1, 0 /*dictSize*/);
 
 
 #ifdef ZSTD_MULTITHREAD