diff --git a/src/utils/huffman_utils.c b/src/utils/huffman_utils.c index 8f12eac1..0c822164 100644 --- a/src/utils/huffman_utils.c +++ b/src/utils/huffman_utils.c @@ -68,8 +68,9 @@ static WEBP_INLINE void ReplicateValue(HuffmanCode* table, int step, int end, // Returns the table width of the next 2nd level table. count is the histogram // of bit lengths for the remaining symbols, len is the code length of the next // processed symbol -static WEBP_INLINE int NextTableBitSize(const int* const count, int len, - int root_bits) { +static WEBP_INLINE int NextTableBitSize( + const int* const WEBP_COUNTED_BY(MAX_ALLOWED_CODE_LENGTH + 1) count, + int len, int root_bits) { int left = 1 << (len - root_bits); while (len < MAX_ALLOWED_CODE_LENGTH) { left -= count[len];