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

Michael Niedermayer git at videolan.org
Sun May 11 20:12:12 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun May 11 20:06:28 2014 +0200| [e2c7816ab0d1998bb07f9138d30fbb41406fca90] | committer: Michael Niedermayer

avcodec/cinepakenc: use av_malloc_array()

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

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

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

diff --git a/libavcodec/cinepakenc.c b/libavcodec/cinepakenc.c
index 9c69ec5..7277345 100644
--- a/libavcodec/cinepakenc.c
+++ b/libavcodec/cinepakenc.c
@@ -236,11 +236,11 @@ static av_cold int cinepak_encode_init(AVCodecContext *avctx)
     if (!(s->frame_buf = av_malloc(frame_buf_size)))
         goto enomem;
 
-    if (!(s->mb = av_malloc(mb_count*sizeof(mb_info))))
+    if (!(s->mb = av_malloc_array(mb_count, sizeof(mb_info))))
         goto enomem;
 
 #ifdef CINEPAKENC_DEBUG
-    if (!(s->best_mb = av_malloc(mb_count*sizeof(mb_info))))
+    if (!(s->best_mb = av_malloc_array(mb_count, sizeof(mb_info))))
         goto enomem;
 #endif
 



More information about the ffmpeg-cvslog mailing list