[FFmpeg-cvslog] avcodec/huffman: use av_malloc_array()

Michael Niedermayer git at videolan.org
Sun Apr 20 18:25:14 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Apr 20 17:25:01 2014 +0200| [69bbe27b45aa2a0a64d2f9b8954ecb7598e62822] | committer: Michael Niedermayer

avcodec/huffman: use av_malloc_array()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=69bbe27b45aa2a0a64d2f9b8954ecb7598e62822
---

 libavcodec/huffman.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavcodec/huffman.c b/libavcodec/huffman.c
index d126e8b..0fc2055 100644
--- a/libavcodec/huffman.c
+++ b/libavcodec/huffman.c
@@ -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;
 



More information about the ffmpeg-cvslog mailing list