OSDN Git Service

avcodec/eatgv: use av_mallocz() for frame_buffer
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 23 Dec 2013 17:09:58 +0000 (18:09 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 24 Dec 2013 22:20:30 +0000 (23:20 +0100)
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@gmx.at>
libavcodec/eatgv.c

index 952ebb3..f204a13 100644 (file)
@@ -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) {