]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Assert `ctx` and `ms` cparams Equivalency
authorW. Felix Handte <w@felixhandte.com>
Thu, 23 Aug 2018 18:38:35 +0000 (11:38 -0700)
committerW. Felix Handte <w@felixhandte.com>
Sat, 29 Sep 2018 00:10:42 +0000 (17:10 -0700)
lib/compress/zstd_compress.c

index ae3626b6d542fbf58b97d50e701ab547b7a21a87..9e16845f25ae448b5bea8e7fa59dc0da9a545b82 100644 (file)
@@ -2356,6 +2356,9 @@ static size_t ZSTD_compressBlock_internal(ZSTD_CCtx* zc,
                 dstCapacity, ms->window.dictLimit, ms->nextToUpdate);
     assert(srcSize <= ZSTD_BLOCKSIZE_MAX);
 
+    /* Assert that we have correctly flushed the ctx params into the ms's copy */
+    assert(ZSTD_equivalentCParams(zc->appliedParams.cParams, ms->cParams));
+
     if (srcSize < MIN_CBLOCK_SIZE+ZSTD_blockHeaderSize+1) {
         ZSTD_ldm_skipSequences(&zc->externSeqStore, srcSize, zc->appliedParams.cParams.searchLength);
         return 0;   /* don't even attempt compression below a certain srcSize */