Skip to content

Commit

Permalink
avcodec/ivi_common: use av_mallocz() to allocate mbs array
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
michaelni committed Dec 26, 2013
1 parent 14bec7d commit d164ad3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libavcodec/ivi_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit d164ad3

Please sign in to comment.