media_module: fix a crash in cts r [1/1]
authorHui Zhang <hui.zhang@amlogic.com>
Fri, 18 Sep 2020 01:51:59 +0000 (09:51 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Fri, 18 Sep 2020 02:53:58 +0000 (19:53 -0700)
PD#SWPL-33266

Problem:
when a invalid vf being detected in vf_put, there are a lot
of printk cause system crash

Solution:
1) add valid checkn for dummy vf in vf_put
2) add debug level for invalid vf printk

Verify:
AC214

Change-Id: I910136a290b95c4c1ca24ad52fb2e5be6e8b6d0b
Signed-off-by: Hui Zhang <hui.zhang@amlogic.com>
drivers/frame_provider/decoder/h264_multi/vmh264.c
drivers/frame_provider/decoder/h265/vh265.c

index 2edfd8781f51416e0636e2eb473d3f20f1b63c4b..2abf92efad98e41a4c106b197b3bd668d0935492 100644 (file)
@@ -4135,7 +4135,7 @@ static bool vf_valid_check(struct vframe_s *vf, struct vdec_h264_hw_s *hw) {
                return true;
        for (i = 0; i < VF_POOL_SIZE; i++) {
                for (j = 0; j < VF_POOL_NUM; j ++) {
-                       if (vf == &(hw->vfpool[j][i]))
+                       if (vf == &(hw->vfpool[j][i]) || vf == &hw->vframe_dummy)
                                return true;
                }
        }
index 06a2957caed431bb481099b7265da2a16ccfecf7..eeb1eecbff70a4f34f1358f806f0c32eb1bc5f6b 100644 (file)
@@ -8537,12 +8537,12 @@ static struct vframe_s *vh265_vf_get(void *op_arg)
 static bool vf_valid_check(struct vframe_s *vf, struct hevc_state_s *hevc) {
        int i;
        for (i = 0; i < VF_POOL_SIZE; i++) {
-               if (vf == &hevc->vfpool[i])
+               if (vf == &hevc->vfpool[i]  || vf == &hevc->vframe_dummy)
                        return true;
        }
-       pr_info(" h265 invalid vf been put, vf = %p\n", vf);
+       hevc_print(hevc, 0," h265 invalid vf been put, vf = %p\n", vf);
        for (i = 0; i < VF_POOL_SIZE; i++) {
-               pr_info("www valid vf[%d]= %p \n", i, &hevc->vfpool[i]);
+               hevc_print(hevc, PRINT_FLAG_VDEC_STATUS,"valid vf[%d]= %p \n", i, &hevc->vfpool[i]);
        }
        return false;
 }