Skip to content

Commit 69c8056

Browse files
jzernGerrit Code Review
authored andcommitted
Merge "Add fbounds-safety annotations for data." into main
2 parents 5d3a9fc + ddabb66 commit 69c8056

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/utils/quant_levels_utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ WEBP_ASSUME_UNSAFE_INDEXABLE_ABI
3030
// -----------------------------------------------------------------------------
3131
// Quantize levels.
3232

33-
int QuantizeLevels(uint8_t* const data, int width, int height, int num_levels,
34-
uint64_t* const sse) {
33+
int QuantizeLevels(uint8_t* const WEBP_COUNTED_BY((size_t)width* height) data,
34+
int width, int height, int num_levels, uint64_t* const sse) {
3535
int freq[NUM_SYMBOLS] = {0};
3636
int q_level[NUM_SYMBOLS] = {0};
3737
double inv_q_level[NUM_SYMBOLS] = {0};

src/utils/quant_levels_utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ extern "C" {
2929
// quantized values. If not NULL, 'sse' will contain the sum of squared error.
3030
// Valid range for 'num_levels' is [2, 256].
3131
// Returns false in case of error (data is NULL, or parameters are invalid).
32-
int QuantizeLevels(uint8_t* const data, int width, int height, int num_levels,
33-
uint64_t* const sse);
32+
int QuantizeLevels(uint8_t* const WEBP_COUNTED_BY((size_t)width* height) data,
33+
int width, int height, int num_levels, uint64_t* const sse);
3434

3535
#ifdef __cplusplus
3636
} // extern "C"

0 commit comments

Comments
 (0)