From e61e3ff15208432cecf09ede09e8ebcf1d126bdd Mon Sep 17 00:00:00 2001 From: elasota <1137273+elasota@users.noreply.github.com> Date: Wed, 8 Nov 2023 20:06:58 -0500 Subject: [PATCH] Clarify that decoding too many Huffman weights is a failure condition --- doc/zstd_compression_format.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/zstd_compression_format.md b/doc/zstd_compression_format.md index 0532a846f..b64ddc3bf 100644 --- a/doc/zstd_compression_format.md +++ b/doc/zstd_compression_format.md @@ -1353,6 +1353,9 @@ If updating state after decoding a symbol would require more bits than remain in the stream, it is assumed that extra bits are 0. Then, symbols for each of the final states are decoded and the process is complete. +If this process would produce more weights than the maximum number of decoded +weights (255), then the data is considered corrupted. + #### Conversion from weights to Huffman prefix codes All present symbols shall now have a `Weight` value. -- 2.47.2