avcodec/huffman: use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
e70b9b32d5
commit
69bbe27b45
@ -54,9 +54,9 @@ static void heap_sift(HeapElem *h, int root, int size)
|
|||||||
|
|
||||||
int ff_huff_gen_len_table(uint8_t *dst, const uint64_t *stats, int size)
|
int ff_huff_gen_len_table(uint8_t *dst, const uint64_t *stats, int size)
|
||||||
{
|
{
|
||||||
HeapElem *h = av_malloc(sizeof(*h) * size);
|
HeapElem *h = av_malloc_array(sizeof(*h), size);
|
||||||
int *up = av_malloc(sizeof(*up) * 2 * size);
|
int *up = av_malloc_array(sizeof(*up) * 2, size);
|
||||||
uint8_t *len = av_malloc(sizeof(*len) * 2 * size);
|
uint8_t *len = av_malloc_array(sizeof(*len) * 2, size);
|
||||||
int offset, i, next;
|
int offset, i, next;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user