From: Elliot Gorokhovsky Date: Thu, 9 Jun 2022 15:39:30 +0000 (-0400) Subject: Bugfix for huge dictionaries X-Git-Tag: v1.5.4^2~204^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=31bd6402c63a33e81513de6511c6447c63456625;p=thirdparty%2Fzstd.git Bugfix for huge dictionaries --- diff --git a/lib/compress/zstd_compress.c b/lib/compress/zstd_compress.c index e43bbec44..6fe46f5b7 100644 --- a/lib/compress/zstd_compress.c +++ b/lib/compress/zstd_compress.c @@ -4219,7 +4219,7 @@ static size_t ZSTD_loadDictionaryContent(ZSTD_matchState_t* ms, * Dictionaries right at the edge will immediately trigger overflow * 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. */ assert(ZSTD_window_isEmpty(ms->window)); if (loadLdmDict)