avcodec/vp9: Use av_malloc_array()
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 25 Aug 2014 16:33:11 +0000 (18:33 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 25 Aug 2014 20:55:11 +0000 (22:55 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/vp9.c

index 8f22685..31725e6 100644 (file)
@@ -368,7 +368,7 @@ static int update_block_buffers(AVCodecContext *ctx)
     if (s->uses_2pass) {
         int sbs = s->sb_cols * s->sb_rows;
 
-        s->b_base = av_malloc(sizeof(VP9Block) * s->cols * s->rows);
+        s->b_base = av_malloc_array(s->cols * s->rows, sizeof(VP9Block));
         s->block_base = av_mallocz((64 * 64 + 128) * sbs * 3);
         if (!s->b_base || !s->block_base)
             return AVERROR(ENOMEM);