avcodec/ratecontrol: use av_malloc_array()
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 20 Apr 2014 15:30:15 +0000 (17:30 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 20 Apr 2014 15:30:15 +0000 (17:30 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/ratecontrol.c

index b5d64e6..a7c96d0 100644 (file)
@@ -952,8 +952,8 @@ static int init_pass2(MpegEncContext *s)
         return -1;
     }
 
-    qscale         = av_malloc(sizeof(double) * rcc->num_entries);
-    blurred_qscale = av_malloc(sizeof(double) * rcc->num_entries);
+    qscale         = av_malloc_array(rcc->num_entries, sizeof(double));
+    blurred_qscale = av_malloc_array(rcc->num_entries, sizeof(double));
     toobig = 0;
 
     for (step = 256 * 256; step > 0.0000001; step *= 0.5) {