vdec: avoid config HEVC_MPRED_TILE_SIZE_LCU with width or height 0 [1/1]
authorapollo.ling <apollo.ling@amlogic.com>
Wed, 30 Dec 2020 08:17:21 +0000 (16:17 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Mon, 4 Jan 2021 07:12:02 +0000 (23:12 -0800)
PD#SWPL-40159

Problem:
Crafted HEVC File Crashes the Device

Solution:
Avoid config HEVC_MPRED_TILE_SIZE_LCU with width or height 0

Verify:
maxwell

Change-Id: I9c1af070da1286d9c776dc06c8b85d5b39d77c3b
Signed-off-by: apollo.ling <apollo.ling@amlogic.com>
drivers/frame_provider/decoder/h265/vh265.c

index bb5870f028cbe00a66102aea0d498e8b813395d0..0b489ade42b1c9833d89468346e22e6bc2b92cbf 100644 (file)
@@ -7801,6 +7801,8 @@ static int hevc_slice_segment_header_process(struct hevc_state_s *hevc,
 #ifdef MCRCC_ENABLE
        config_mcrcc_axi_hw(hevc, hevc->cur_pic->slice_type);
 #endif
+       if (!hevc->tile_width_lcu || !hevc->tile_height_lcu)
+               return -1;
        config_mpred_hw(hevc);
 
        config_sao_hw(hevc, rpm_param);