From 07793547e649e75452cbb426fb3df1c9b6e0235e Mon Sep 17 00:00:00 2001 From: "W. Felix Handte" Date: Fri, 4 Sep 2020 12:16:35 -0400 Subject: [PATCH] Fix Bug: Only Use DDSS Insertion on CDict MatchStates Previously, if DDSS was enabled on a CCtx and a dictionary was inserted into the CCtx, the CCtx MatchState would be filled as a DDSS struct, causing segfaults etc. This changes the check to use whether the MatchState is marked as using the DDSS (which is only ever set for CDict MatchStates), rather than looking at the CCtxParams. --- lib/compress/zstd_compress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index bec9afd79..3e253006a 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -2914,7 +2914,7 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms, case ZSTD_greedy: case ZSTD_lazy: case ZSTD_lazy2: - if (chunk >= HASH_READ_SIZE && params->enableDedicatedDictSearch) + if (chunk >= HASH_READ_SIZE && ms->dedicatedDictSearch) ZSTD_dedicatedDictSearch_lazy_loadDictionary(ms, ichunk-HASH_READ_SIZE); else if (chunk >= HASH_READ_SIZE) ZSTD_insertAndFindFirstIndex(ms, ichunk-HASH_READ_SIZE); -- 2.47.2