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,6 +124,10 @@ static int BuildHuffmanTable(HuffmanCode* const root_table, int root_bits,
|
|||||||
const int symbol_code_length = code_lengths[symbol];
|
const int symbol_code_length = code_lengths[symbol];
|
||||||
if (code_lengths[symbol] > 0) {
|
if (code_lengths[symbol] > 0) {
|
||||||
if (sorted != NULL) {
|
if (sorted != NULL) {
|
||||||
|
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) {
|
if (offset[symbol_code_length] >= code_lengths_size) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user