webp-lossless-bitstream-spec: add validity note for max_symbol

Bug: webp:611
Change-Id: Id56ca4fd0ad3cfc17c9c971281ccfb8ce7eaa2f4
This commit is contained in:
James Zern 2023-07-07 15:49:56 -07:00
parent 71916726b6
commit e4fc2f78c7

View File

@ -940,6 +940,9 @@ int length_nbits = 2 + 2 * ReadBits(3);
int max_symbol = 2 + ReadBits(length_nbits);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If `max_symbol` is larger than the size of the alphabet for the symbol type, the
bitstream is invalid.
A prefix table is then built from `code_length_code_lengths` and used to read up
to `max_symbol` code lengths.