Merge pull request #3813 from elasota/overflow-clarification

Clarify that a stream containing too many Huffman weights is invalid
This commit is contained in:
Yann Collet 2023-11-13 00:03:42 -08:00 committed by GitHub
commit e19fe535f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.