Skip to content

Commit

Permalink
Merge pull request #4013 from elasota/spec-clarify-offset-code-overflow
Browse files Browse the repository at this point in the history
Specify that decoders may reject non-zero probabilities for larger offset codes than implementation supports
  • Loading branch information
Cyan4973 authored Sep 27, 2024
2 parents 9215de5 + c54f478 commit d2212c6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion doc/zstd_compression_format.md
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,10 @@ When last symbol reaches cumulated total of `1 << Accuracy_Log`,
decoding is complete.
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.
not used, then the data is considered corrupted. In the case of offset codes,
a decoder implementation may reject a frame containing a non-zero probability
for an offset code larger than the largest offset code supported by the decoder
implementation.

Then the decoder can tell how many bytes were used in this process,
and how many symbols are present.
Expand Down

0 comments on commit d2212c6

Please sign in to comment.