diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-05-15 22:41:52 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-05-15 22:41:52 +0200 |
commit | 82fb849678cef40f7b24d11a136b8661dcd13f42 (patch) | |
tree | 74984f7a83b27d654b37c723c178adc3f505568c /thirdparty/libwebp/src/utils/huffman_utils.c | |
parent | 2749645d2a7173308228aa5fb0793a260fab733f (diff) | |
parent | 09bd34df934a815279ffe73045d10e7f4b2f9660 (diff) | |
download | redot-engine-82fb849678cef40f7b24d11a136b8661dcd13f42.tar.gz |
Merge pull request #91943 from akien-mga/libwebp-1.4.0
libwebp: Update to 1.4.0
Diffstat (limited to 'thirdparty/libwebp/src/utils/huffman_utils.c')
-rw-r--r-- | thirdparty/libwebp/src/utils/huffman_utils.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/thirdparty/libwebp/src/utils/huffman_utils.c b/thirdparty/libwebp/src/utils/huffman_utils.c index cf73abd437..16f9faaa9a 100644 --- a/thirdparty/libwebp/src/utils/huffman_utils.c +++ b/thirdparty/libwebp/src/utils/huffman_utils.c @@ -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]++; @@ -267,11 +270,11 @@ int VP8LHuffmanTablesAllocate(int size, HuffmanTables* huffman_tables) { // Have 'segment' point to the first segment for now, 'root'. HuffmanTablesSegment* const root = &huffman_tables->root; huffman_tables->curr_segment = root; + root->next = NULL; // Allocate root. root->start = (HuffmanCode*)WebPSafeMalloc(size, sizeof(*root->start)); if (root->start == NULL) return 0; root->curr_table = root->start; - root->next = NULL; root->size = size; return 1; } |