1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-30 22:23:13 +03:00

Throw error if Huffman weight initial states are truncated

This commit is contained in:
elasota
2024-06-20 15:19:58 -04:00
parent 17b5315016
commit 0938308ff6
4 changed files with 26 additions and 0 deletions

View File

@ -1362,6 +1362,10 @@ 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.
If either of the 2 initial states are absent or truncated, then the data is
considered corrupted. Consequently, it is not possible to encode fewer than
2 weights using this mode.
#### Conversion from weights to Huffman prefix codes
All present symbols shall now have a `Weight` value.