diff --git a/src/utils/huffman_encode_utils.c b/src/utils/huffman_encode_utils.c index 45f758ea..1b18f384 100644 --- a/src/utils/huffman_encode_utils.c +++ b/src/utils/huffman_encode_utils.c @@ -139,7 +139,7 @@ static int CompareHuffmanTrees(const void* ptr1, const void* ptr2) { static void SetBitDepths(const HuffmanTree* const tree, const HuffmanTree* const pool, - uint8_t* const bit_depths, int level) { + uint8_t* WEBP_INDEXABLE const bit_depths, int level) { if (tree->pool_index_left >= 0) { SetBitDepths(&pool[tree->pool_index_left], pool, bit_depths, level + 1); SetBitDepths(&pool[tree->pool_index_right], pool, bit_depths, level + 1); @@ -170,7 +170,8 @@ static void SetBitDepths(const HuffmanTree* const tree, static void GenerateOptimalTree(const uint32_t* const histogram, int histogram_size, HuffmanTree* tree, int tree_depth_limit, - uint8_t* const bit_depths) { + uint8_t* WEBP_COUNTED_BY(histogram_size) + const bit_depths) { uint32_t count_min; HuffmanTree* tree_pool; int tree_size_orig = 0; diff --git a/src/utils/huffman_encode_utils.h b/src/utils/huffman_encode_utils.h index 98dc61da..d80f96b1 100644 --- a/src/utils/huffman_encode_utils.h +++ b/src/utils/huffman_encode_utils.h @@ -31,9 +31,11 @@ typedef struct { // Struct to represent the tree codes (depth and bits array). typedef struct { - int num_symbols; // Number of symbols. - uint8_t* code_lengths; // Code lengths of the symbols. - uint16_t* codes; // Symbol Codes. + int num_symbols; // Number of symbols. + // Code lengths of the symbols. + uint8_t* WEBP_COUNTED_BY(num_symbols) code_lengths; + // Symbol Codes. + uint16_t* WEBP_COUNTED_BY(num_symbols) codes; } HuffmanTreeCode; // Struct to represent the Huffman tree.