diff --git a/src/utils/huffman_utils.c b/src/utils/huffman_utils.c index 5b60a00e..8f12eac1 100644 --- a/src/utils/huffman_utils.c +++ b/src/utils/huffman_utils.c @@ -227,7 +227,9 @@ static int BuildHuffmanTable(HuffmanCode* const root_table, int root_bits, // Cut-off value for switching between heap and stack allocation. #define SORTED_SIZE_CUTOFF 512 int VP8LBuildHuffmanTable(HuffmanTables* const root_table, int root_bits, - const int code_lengths[], int code_lengths_size) { + const int WEBP_COUNTED_BY(code_lengths_size) + code_lengths[], + int code_lengths_size) { const int total_size = BuildHuffmanTable(NULL, root_bits, code_lengths, code_lengths_size, NULL); assert(code_lengths_size <= MAX_CODE_LENGTHS_SIZE); diff --git a/src/utils/huffman_utils.h b/src/utils/huffman_utils.h index 1468b07b..564de56f 100644 --- a/src/utils/huffman_utils.h +++ b/src/utils/huffman_utils.h @@ -105,10 +105,10 @@ void VP8LHtreeGroupsFree(HTreeGroup* const htree_groups); // the huffman table. // Returns built table size or 0 in case of error (invalid tree or // memory error). -WEBP_NODISCARD int VP8LBuildHuffmanTable(HuffmanTables* const root_table, - int root_bits, - const int code_lengths[], - int code_lengths_size); +WEBP_NODISCARD int VP8LBuildHuffmanTable( + HuffmanTables* const root_table, int root_bits, + const int WEBP_COUNTED_BY(code_lengths_size) code_lengths[], + int code_lengths_size); #ifdef __cplusplus } // extern "C"