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

Michael Niedermayer git at videolan.org
Sat May 3 20:13:47 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat May  3 19:18:22 2014 +0200| [cc861581735b08817c7fbacd38ffab73fb9fe38a] | committer: Michael Niedermayer

avcodec/ffv1dec: use av_malloc_array()

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

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

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

diff --git a/libavcodec/ffv1dec.c b/libavcodec/ffv1dec.c
index d7dd110..a0a50ab 100644
--- a/libavcodec/ffv1dec.c
+++ b/libavcodec/ffv1dec.c
@@ -380,10 +380,10 @@ static int decode_slice(AVCodecContext *c, void *arg)
             pdst->vlc_state = NULL;
 
             if (fssrc->ac) {
-                pdst->state = av_malloc(CONTEXT_SIZE * psrc->context_count);
+                pdst->state = av_malloc_array(CONTEXT_SIZE,  psrc->context_count);
                 memcpy(pdst->state, psrc->state, CONTEXT_SIZE * psrc->context_count);
             } else {
-                pdst->vlc_state = av_malloc(sizeof(*pdst->vlc_state) * psrc->context_count);
+                pdst->vlc_state = av_malloc_array(sizeof(*pdst->vlc_state), psrc->context_count);
                 memcpy(pdst->vlc_state, psrc->vlc_state, sizeof(*pdst->vlc_state) * psrc->context_count);
             }
         }



More information about the ffmpeg-cvslog mailing list