aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-11 20:23:51 +0100
committerReinhard Tartler <siretart@tauware.de>2014-03-09 14:55:35 -0400
commitd79cb6947e4a9c42ac20925dd920d3a0910d9a26 (patch)
tree3cc987dd99d5899fe274abefa1410afe8c1d6d92
parent5aa4b29bbefc06fc2bbcb52af7a14393a1bcf504 (diff)
downloadffmpeg-d79cb6947e4a9c42ac20925dd920d3a0910d9a26.tar.gz
hevc: use av_mallocz() for allocating tab_ipm
Fixes use of uninitialized memory and out of stack array read. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind (cherry picked from commit 6cc94e971933cd38c452172bb048bf760e65cc3e)
-rw-r--r--libavcodec/hevc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c
index 65ad6d9730..f8f7e64eb4 100644
--- a/libavcodec/hevc.c
+++ b/libavcodec/hevc.c
@@ -212,7 +212,7 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps)
goto fail;
s->cbf_luma = av_malloc(sps->min_tb_width * sps->min_tb_height);
- s->tab_ipm = av_malloc(min_pu_size);
+ s->tab_ipm = av_mallocz(min_pu_size);
s->is_pcm = av_malloc(min_pu_size);
if (!s->tab_ipm || !s->cbf_luma || !s->is_pcm)
goto fail;