Merge "Add fbounds-safety annotations for count." into main

This commit is contained in:
James Zern
2025-08-20 12:24:13 -07:00
committed by Gerrit Code Review

View File

@@ -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];