[FFmpeg-cvslog] avcodec/ratecontrol: 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:30:15 2014 +0200| [1fd5c7f1ee2fe32b6ea027a1252e8a52fc034d7d] | committer: Michael Niedermayer

avcodec/ratecontrol: use av_malloc_array()

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

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

 libavcodec/ratecontrol.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c
index b5d64e6..a7c96d0 100644
--- a/libavcodec/ratecontrol.c
+++ b/libavcodec/ratecontrol.c
@@ -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) {



More information about the ffmpeg-cvslog mailing list