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

This commit is contained in:
James Zern
2025-08-20 12:28:49 -07:00
committed by Gerrit Code Review
2 changed files with 4 additions and 4 deletions

View File

@@ -30,8 +30,8 @@ WEBP_ASSUME_UNSAFE_INDEXABLE_ABI
// -----------------------------------------------------------------------------
// Quantize levels.
int QuantizeLevels(uint8_t* const data, int width, int height, int num_levels,
uint64_t* const sse) {
int QuantizeLevels(uint8_t* const WEBP_COUNTED_BY((size_t)width* height) data,
int width, int height, int num_levels, uint64_t* const sse) {
int freq[NUM_SYMBOLS] = {0};
int q_level[NUM_SYMBOLS] = {0};
double inv_q_level[NUM_SYMBOLS] = {0};

View File

@@ -29,8 +29,8 @@ extern "C" {
// quantized values. If not NULL, 'sse' will contain the sum of squared error.
// Valid range for 'num_levels' is [2, 256].
// Returns false in case of error (data is NULL, or parameters are invalid).
int QuantizeLevels(uint8_t* const data, int width, int height, int num_levels,
uint64_t* const sse);
int QuantizeLevels(uint8_t* const WEBP_COUNTED_BY((size_t)width* height) data,
int width, int height, int num_levels, uint64_t* const sse);
#ifdef __cplusplus
} // extern "C"