From bb9f55163f17145d5b220b38e23c7d55824ec7c5 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 23 Dec 2013 18:09:58 +0100 Subject: [PATCH] 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 --- libavcodec/eatgv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c index 952ebb3c34..f204a1344c 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) { -- 2.11.0