mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-06 11:04:30 +02:00
Compare commits
1 Commits
v1.6.0-rc1
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
fa6f56496a |
@ -124,7 +124,11 @@ static int BuildHuffmanTable(HuffmanCode* const root_table, int root_bits,
|
||||
const int symbol_code_length = code_lengths[symbol];
|
||||
if (code_lengths[symbol] > 0) {
|
||||
if (sorted != NULL) {
|
||||
if(offset[symbol_code_length] >= code_lengths_size) {
|
||||
assert(offset[symbol_code_length] < code_lengths_size);
|
||||
// The following check is not redundant with the assert. It prevents a
|
||||
// potential buffer overflow that the optimizer might not be able to
|
||||
// rule out on its own.
|
||||
if (offset[symbol_code_length] >= code_lengths_size) {
|
||||
return 0;
|
||||
}
|
||||
sorted[offset[symbol_code_length]++] = symbol;
|
||||
|
Loading…
x
Reference in New Issue
Block a user