]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
fixed ZSTDMT_initCStream() when contentSizeFlag==1 by default
authorYann Collet <cyan@fb.com>
Sat, 14 Oct 2017 02:09:30 +0000 (19:09 -0700)
committerYann Collet <cyan@fb.com>
Sat, 14 Oct 2017 02:09:30 +0000 (19:09 -0700)
and a wrong test in zstreamtest --mt

lib/compress/zstdmt_compress.c
tests/zstreamtest.c

index 17c69c9dfe4c2140fdd3cb34b7ffb08a343145c4..197a2c49e14515a39071ba100d0506ed08264ffe 100644 (file)
@@ -852,7 +852,7 @@ size_t ZSTDMT_initCStream(ZSTDMT_CCtx* zcs, int compressionLevel) {
     ZSTD_CCtx_params cctxParams = zcs->params;
     cctxParams.cParams = params.cParams;
     cctxParams.fParams = params.fParams;
-    return ZSTDMT_initCStream_internal(zcs, NULL, 0, ZSTD_dm_auto, NULL, cctxParams, 0);
+    return ZSTDMT_initCStream_internal(zcs, NULL, 0, ZSTD_dm_auto, NULL, cctxParams, ZSTD_CONTENTSIZE_UNKNOWN);
 }
 
 
index 3aea22709aebdbe66cb203e4266cffdc171e0c97..38320e8c48b5cc606bd6ce718bc4b90f83516831 100644 (file)
@@ -1088,13 +1088,13 @@ static int fuzzerTests_MT(U32 seed, U32 nbTests, unsigned startTest, double comp
             {   size_t const dictStart = FUZ_rand(&lseed) % (srcBufferSize - dictSize);
                 dict = srcBuffer + dictStart;
             }
-            {   U64 const pledgedSrcSize = (FUZ_rand(&lseed) & 3) ? 0 : maxTestSize;
+            {   U64 const pledgedSrcSize = (FUZ_rand(&lseed) & 3) ? ZSTD_CONTENTSIZE_UNKNOWN : maxTestSize;
                 ZSTD_parameters params = ZSTD_getParams(cLevel, pledgedSrcSize, dictSize);
                 DISPLAYLEVEL(5, "Init with windowLog = %u and pledgedSrcSize = %u \n",
                     params.cParams.windowLog, (U32)pledgedSrcSize);
                 params.fParams.checksumFlag = FUZ_rand(&lseed) & 1;
                 params.fParams.noDictIDFlag = FUZ_rand(&lseed) & 1;
-                params.fParams.contentSizeFlag = pledgedSrcSize>0;
+                params.fParams.contentSizeFlag = FUZ_rand(&lseed) & 1;
                 DISPLAYLEVEL(5, "checksumFlag : %u \n", params.fParams.checksumFlag);
                 CHECK_Z( ZSTDMT_initCStream_advanced(zc, dict, dictSize, params, pledgedSrcSize) );
                 CHECK_Z( ZSTDMT_setMTCtxParameter(zc, ZSTDMT_p_overlapSectionLog, FUZ_rand(&lseed) % 12) );