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

Paul B Mahol git at videolan.org
Tue Feb 10 10:39:31 CET 2015


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Feb  9 13:33:11 2015 +0000| [e4eba9e21d71f6430c3608d530b69810868dd5d7] | committer: Paul B Mahol

avcodec/mss4: use av_malloc_array()

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavcodec/mss4.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/mss4.c b/libavcodec/mss4.c
index c5b8e07..07d90ed 100644
--- a/libavcodec/mss4.c
+++ b/libavcodec/mss4.c
@@ -650,7 +650,7 @@ static av_cold int mss4_decode_init(AVCodecContext *avctx)
     }
     for (i = 0; i < 3; i++) {
         c->dc_stride[i] = FFALIGN(avctx->width, 16) >> (2 + !!i);
-        c->prev_dc[i]   = av_malloc(sizeof(**c->prev_dc) * c->dc_stride[i]);
+        c->prev_dc[i]   = av_malloc_array(c->dc_stride[i], sizeof(**c->prev_dc));
         if (!c->prev_dc[i]) {
             av_log(avctx, AV_LOG_ERROR, "Cannot allocate buffer\n");
             mss4_free_vlcs(c);



More information about the ffmpeg-cvslog mailing list