Browse Source

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
tags/n2.3
Michael Niedermayer Vittorio Giovara 11 years ago
parent
commit
6cc94e9719
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      libavcodec/hevc.c

+ 1
- 1
libavcodec/hevc.c View 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;


Loading…
Cancel
Save