]> git.sesse.net Git - ffmpeg/commitdiff
hevc: use av_mallocz() for allocating tab_ipm
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 11 Jan 2014 19:23:51 +0000 (20:23 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Sun, 9 Mar 2014 16:08:11 +0000 (17:08 +0100)
Fixes use of uninitialized memory and out of stack array read.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
libavcodec/hevc.c

index 65ad6d9730134ed163ae6ed28331e817d8c342f4..f8f7e64eb42142f99f8c2ae250b1228e76db3988 100644 (file)
@@ -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;