mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-25 21:28:22 +01:00
BuildHuffmanTable check sorted[] array bounds before writing
Change-Id: I6a83f414e86311121451e9da26004dfc3ac9b21f
This commit is contained in:
parent
a429c0de64
commit
0b56dedc98
@ -122,6 +122,9 @@ 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) {
|
||||
return 0;
|
||||
}
|
||||
sorted[offset[symbol_code_length]++] = symbol;
|
||||
} else {
|
||||
offset[symbol_code_length]++;
|
||||
|
Loading…
Reference in New Issue
Block a user