Bugfix for huge dictionaries

This commit is contained in:
Elliot Gorokhovsky 2022-06-09 11:39:30 -04:00
parent 9a5e73c74e
commit 31bd6402c6

View File

@ -4219,7 +4219,7 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms,
* Dictionaries right at the edge will immediately trigger overflow * Dictionaries right at the edge will immediately trigger overflow
* correction, but I don't want to insert extra constraints here. * correction, but I don't want to insert extra constraints here.
*/ */
U32 const maxDictSize = ZSTD_CURRENT_MAX - 1; U32 const maxDictSize = ZSTD_CURRENT_MAX - ZSTD_WINDOW_START_INDEX;
/* We must have cleared our windows when our source is this large. */ /* We must have cleared our windows when our source is this large. */
assert(ZSTD_window_isEmpty(ms->window)); assert(ZSTD_window_isEmpty(ms->window));
if (loadLdmDict) if (loadLdmDict)