Merge pull request #3817 from elasota/oversized-probs-clarification

Clarify that probability tables must not contain non-zero probabilities for invalid values
This commit is contained in:
Yann Collet 2024-01-13 11:37:54 -08:00 committed by GitHub
commit 7971fd16f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1124,6 +1124,9 @@ When last symbol reaches cumulated total of `1 << Accuracy_Log`,
decoding is complete.
If the last symbol makes cumulated total go above `1 << Accuracy_Log`,
distribution is considered corrupted.
If this process results in a non-zero probability for a value outside of the
valid range of values that the FSE table is defined for, even if that value is
not used, then the data is considered corrupted.
Then the decoder can tell how many bytes were used in this process,
and how many symbols are present.