Skip to content

Commit

Permalink
Clarify value-limiting behavior for offset codes (since they have no …
Browse files Browse the repository at this point in the history
…upper bound)
  • Loading branch information
elasota committed Mar 22, 2024
1 parent 512bc37 commit 01c97ab
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions doc/zstd_compression_format.md
Original file line number Diff line number Diff line change
Expand Up @@ -1125,8 +1125,14 @@ the last byte used or partially used by probability decoding. If the last
byte was partially used, then any unused bits are ignored.

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.
valid range of values that the FSE table is defined for, then the data is
considered corrupted, even if the value is not used.

In the case of offset codes, a decoder may reject a frame that encodes a
non-zero probability for an offset code that exceeds the decoder's
maximum allowed offset code. A compliant encoder should not emit non-zero
probabilities for offset codes that are greater than the highest offset
code value present in the data stream.

__Example__ :

Expand Down

0 comments on commit 01c97ab

Please sign in to comment.