From 3483f89101671d797a8776f4881555cbab80f932 Mon Sep 17 00:00:00 2001 From: "W. Felix Handte" Date: Thu, 23 Aug 2018 11:57:54 -0700 Subject: [PATCH] Also Assert Equivalency When Filling MatchState with Prefix --- lib/compress/zstd_compress.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index b9785195f..ecde50254 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -2700,6 +2700,9 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms, ZSTD_window_update(&ms->window, src, srcSize); ms->loadedDictEnd = params->forceWindow ? 0 : (U32)(iend - ms->window.base); + /* Assert that we the ms params match the params we're being given */ + assert(ZSTD_equivalentCParams(params->cParams, ms->cParams)); + if (srcSize <= HASH_READ_SIZE) return 0; switch(params->cParams.strategy) -- 2.47.2