]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Also Assert Equivalency When Filling MatchState with Prefix
authorW. Felix Handte <w@felixhandte.com>
Thu, 23 Aug 2018 18:57:54 +0000 (11:57 -0700)
committerW. Felix Handte <w@felixhandte.com>
Sat, 29 Sep 2018 00:10:42 +0000 (17:10 -0700)
lib/compress/zstd_compress.c

index b9785195f5076f053c7b2d9437280989f5e71d0a..ecde5025456db1d0e857d7abc03a9ecdf2359557 100644 (file)
@@ -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)