]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Bugfix for huge dictionaries 3157/head
authorElliot Gorokhovsky <embg@fb.com>
Thu, 9 Jun 2022 15:39:30 +0000 (11:39 -0400)
committerElliot Gorokhovsky <embg@fb.com>
Thu, 9 Jun 2022 15:39:30 +0000 (11:39 -0400)
lib/compress/zstd_compress.c

index e43bbec44fcc7c4a26595c72ab674292bda547db..6fe46f5b78f6453de2f0cd708ead88a84a1bda49 100644 (file)
@@ -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)