diff --git a/src/utils/quant_levels_utils.c b/src/utils/quant_levels_utils.c index 71401647..5c1c767b 100644 --- a/src/utils/quant_levels_utils.c +++ b/src/utils/quant_levels_utils.c @@ -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}; diff --git a/src/utils/quant_levels_utils.h b/src/utils/quant_levels_utils.h index 43eecf2a..e2e4486d 100644 --- a/src/utils/quant_levels_utils.h +++ b/src/utils/quant_levels_utils.h @@ -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"