From: W. Felix Handte Date: Thu, 23 Aug 2018 18:38:35 +0000 (-0700) Subject: Assert `ctx` and `ms` cparams Equivalency X-Git-Tag: v1.3.6^2~10^2~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03103269de51fdc5853d073ce7994fce6491ec73;p=thirdparty%2Fzstd.git Assert `ctx` and `ms` cparams Equivalency --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index ae3626b6d..9e16845f2 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -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 */