Files
libwebp/src
Arman Hasanzadeh f66f1ee95c Add fbounds-safety annotations for count.
Reasoning:

The function `NextTableBitSize` is only called by `BuildHuffmanTable`
(src/utils/huffman_utils.c:196). In `BuildHuffmanTable`, `count` is
defined as a local array `int count[MAX_ALLOWED_CODE_LENGTH + 1]`
(line 93). This array decays to a pointer when passed to
`NextTableBitSize`. The maximum index accessed within `NextTableBitSize`
is `MAX_ALLOWED_CODE_LENGTH - 1` (line 75, inside a loop where `len`
starts <= `MAX_ALLOWED_CODE_LENGTH` and increments up to
`MAX_ALLOWED_CODE_LENGTH`).

Since the caller provides an array of size `MAX_ALLOWED_CODE_LENGTH + 1`
and the accesses are within bounds, the `count` parameter in
`NextTableBitSize` is annotated with
`WEBP_COUNTED_BY(MAX_ALLOWED_CODE_LENGTH + 1)`. This resolves the
compiler error.

Bug: 432511821
Change-Id: I29a55dd7f09c04aa3a2394996cf0e123d985fcd0
2025-08-19 22:15:25 -07:00
..
2025-07-31 14:53:58 -07:00
2025-07-31 14:53:58 -07:00
2025-07-31 14:53:58 -07:00
2025-07-31 14:53:58 -07:00
2025-07-31 14:53:58 -07:00
2025-06-30 12:26:15 -07:00
2025-06-30 12:26:15 -07:00
2025-06-30 12:26:15 -07:00