From d164ad3298c155330e303bea907920643b5d74a3 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Mon, 23 Dec 2013 18:09:58 +0100 Subject: [PATCH] avcodec/ivi_common: use av_mallocz() to allocate mbs array Fixes use of uninitialized memory Fixes: msan_uninit-mem_7f1dffa1c016_8245_sasha.avi Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- libavcodec/ivi_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/ivi_common.c b/libavcodec/ivi_common.c index 9b5f5f876e880..a4d24345a73b9 100644 --- a/libavcodec/ivi_common.c +++ b/libavcodec/ivi_common.c @@ -363,7 +363,7 @@ static int ivi_init_tiles(IVIBandDesc *band, IVITile *ref_tile, band->mb_size); av_freep(&tile->mbs); - tile->mbs = av_malloc(tile->num_MBs * sizeof(IVIMbInfo)); + tile->mbs = av_mallocz(tile->num_MBs * sizeof(IVIMbInfo)); if (!tile->mbs) return AVERROR(ENOMEM);