[FFmpeg-cvslog] avcodec/cfhd: clear idwt_buf on allocation

Michael Niedermayer git at videolan.org
Sun Jun 5 16:37:00 CEST 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Feb 14 20:22:49 2016 +0100| [5fb6e39dd1c3add4dc5bd7c7f0d8100d5aadad46] | committer: Michael Niedermayer

avcodec/cfhd: clear idwt_buf on allocation

This avoids use of uninitialized variables and might make bugs in general
easier to reproduce

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index d15cd8d..0e6abe0 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -182,7 +182,7 @@ static int alloc_buffers(AVCodecContext *avctx)
         w2 = w4 * 2;
         h2 = h4 * 2;
 
-        s->plane[i].idwt_buf = av_malloc_array(height * stride, sizeof(*s->plane[i].idwt_buf));
+        s->plane[i].idwt_buf = av_mallocz_array(height * stride, sizeof(*s->plane[i].idwt_buf));
         s->plane[i].idwt_tmp = av_malloc_array(height * stride, sizeof(*s->plane[i].idwt_tmp));
         if (!s->plane[i].idwt_buf || !s->plane[i].idwt_tmp) {
             return AVERROR(ENOMEM);



More information about the ffmpeg-cvslog mailing list