From: elasota <1137273+elasota@users.noreply.github.com> Date: Thu, 9 Nov 2023 01:06:58 +0000 (-0500) Subject: Clarify that decoding too many Huffman weights is a failure condition X-Git-Tag: v1.5.6^2~106^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e61e3ff15208432cecf09ede09e8ebcf1d126bdd;p=thirdparty%2Fzstd.git Clarify that decoding too many Huffman weights is a failure condition --- 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.