提交 701c965a 编写于 作者: M Michael Niedermayer

avcodec/hevc_ps: Check that log2_ctb_size is not smaller than the bounds of all profiles

Fixes: unaligned memory access
Fixes: signal_sigsegv_3344165_576_cov_3406448105_DBLK_A_MAIN10_VIXS_2.bit

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Suggested-by: NChristophe Gisquet <christophe.gisquet@gmail.com>
Signed-off-by: NMichael Niedermayer <michaelni@gmx.at>
上级 dd369c9a
......@@ -1083,6 +1083,14 @@ int ff_hevc_decode_nal_sps(HEVCContext *s)
av_log(s->avctx, AV_LOG_ERROR, "CTB size out of range: 2^%d\n", sps->log2_ctb_size);
goto err;
}
if (sps->log2_ctb_size < 4) {
av_log(s->avctx,
AV_LOG_ERROR,
"log2_ctb_size %d differs from the bounds of any known profile\n",
sps->log2_ctb_size);
avpriv_request_sample(s->avctx, "log2_ctb_size %d", sps->log2_ctb_size);
goto err;
}
if (sps->max_transform_hierarchy_depth_inter > sps->log2_ctb_size - sps->log2_min_tb_size) {
av_log(s->avctx, AV_LOG_ERROR, "max_transform_hierarchy_depth_inter out of range: %d\n",
sps->max_transform_hierarchy_depth_inter);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册