diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-02-07 02:37:18 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-02-23 14:51:22 +0100 |
commit | 69f99f80d1255f3ae7c4d29f8ce3a771d9aeb6b8 (patch) | |
tree | a9c4b52f5d947081199316f0970f48fba1114613 /libavcodec | |
parent | e7b7e694168663813fdf1e99e0d1142cfd88e44b (diff) | |
download | ffmpeg-69f99f80d1255f3ae7c4d29f8ce3a771d9aeb6b8.tar.gz |
avcodec/hevc: clear tab_slice_address in hevc_frame_start()
Fixes inconsistencies
Fixes use of uninitilaized memory
Fixes part of cb307d24befbd109c6f054008d6777b5/asan_static-oob_124a175_1445_cov_2355279992_DBLK_D_VIXS_1.bit
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 56985d26d7054079cbe8865532c4a2cff123f596)
Conflicts:
libavcodec/hevc.c
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/hevc.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/hevc.c b/libavcodec/hevc.c index 3ad8655aac..310c21378a 100644 --- a/libavcodec/hevc.c +++ b/libavcodec/hevc.c @@ -2049,13 +2049,16 @@ static void restore_tqb_pixels(HEVCContext *s) static int hevc_frame_start(HEVCContext *s) { - HEVCLocalContext *lc = s->HEVClc; + HEVCLocalContext *lc = s->HEVClc; + int pic_size_in_ctb = ((s->sps->width >> s->sps->log2_min_cb_size) + 1) * + ((s->sps->height >> s->sps->log2_min_cb_size) + 1); int ret; memset(s->horizontal_bs, 0, 2 * s->bs_width * (s->bs_height + 1)); memset(s->vertical_bs, 0, 2 * s->bs_width * (s->bs_height + 1)); memset(s->cbf_luma, 0, s->sps->min_tb_width * s->sps->min_tb_height); memset(s->is_pcm, 0, s->sps->min_pu_width * s->sps->min_pu_height); + memset(s->tab_slice_address, -1, pic_size_in_ctb * sizeof(*s->tab_slice_address)); lc->start_of_tiles_x = 0; s->is_decoded = 0; |