mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-12 22:14:29 +02:00
ReadHuffmanCode: rm redundant num code lengths check
4 bits are read ([0, 15]) with 4 added to the result. The check that the result is not > NUM_CODE_LENGTH_CODES (19) is redundant. This makes the check an assert for documentation purposes. webp-lossless-bitstream-spec.txt is updated accordingly. Bug: webp:611 Change-Id: Ie461017dc9de3da4cfe6856543d3dcf58f53a180
This commit is contained in:
@ -904,8 +904,6 @@ First, `num_code_lengths` specifies the number of code lengths.
|
||||
int num_code_lengths = 4 + ReadBits(4);
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If `num_code_lengths` is greater than 19, the bitstream is invalid.
|
||||
|
||||
The code lengths are themselves encoded using prefix codes; lower-level code
|
||||
lengths, `code_length_code_lengths`, first have to be read. The rest of those
|
||||
`code_length_code_lengths` (according to the order in `kCodeLengthCodeOrder`)
|
||||
|
Reference in New Issue
Block a user