]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/huffman: use av_malloc_array()
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 20 Apr 2014 15:25:01 +0000 (17:25 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 20 Apr 2014 15:25:01 +0000 (17:25 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/huffman.c

index d126e8ba356805d59df43d8ee36cebde238faaba..0fc2055dbeb9fa1d398d5666387fd363abd191cb 100644 (file)
@@ -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)
 {
-    HeapElem *h  = av_malloc(sizeof(*h) * size);
-    int *up      = av_malloc(sizeof(*up) * 2 * size);
-    uint8_t *len = av_malloc(sizeof(*len) * 2 * size);
+    HeapElem *h  = av_malloc_array(sizeof(*h), size);
+    int *up      = av_malloc_array(sizeof(*up) * 2, size);
+    uint8_t *len = av_malloc_array(sizeof(*len) * 2, size);
     int offset, i, next;
     int ret = 0;