[FFmpeg-cvslog] avcodec/eatgv: use av_mallocz() for frame_buffer

Michael Niedermayer git at videolan.org
Tue Dec 24 23:29:33 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Dec 23 18:09:58 2013 +0100| [bb9f55163f17145d5b220b38e23c7d55824ec7c5] | committer: Michael Niedermayer

avcodec/eatgv: use av_mallocz() for frame_buffer

Fixes use of uninitialized memory
Fixes: msan_uninit-mem_7fbf6159587b_2571_ORIGIN.TGV
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c
index 952ebb3..f204a13 100644
--- a/libavcodec/eatgv.c
+++ b/libavcodec/eatgv.c
@@ -311,7 +311,7 @@ static int tgv_decode_frame(AVCodecContext *avctx,
         frame->pict_type = AV_PICTURE_TYPE_I;
 
         if (!s->frame_buffer &&
-            !(s->frame_buffer = av_malloc(s->width * s->height)))
+            !(s->frame_buffer = av_mallocz(s->width * s->height)))
             return AVERROR(ENOMEM);
 
         if (unpack(buf, buf_end, s->frame_buffer, s->avctx->width, s->avctx->height) < 0) {



More information about the ffmpeg-cvslog mailing list