vdec: avoid to use NULL pointer [1/1]
authorapollo.ling <apollo.ling@amlogic.com>
Sun, 27 Sep 2020 07:05:38 +0000 (15:05 +0800)
committerapollo.ling <apollo.ling@amlogic.com>
Sun, 27 Sep 2020 07:05:45 +0000 (15:05 +0800)
PD#SWPL-34229

Problem:
DTV H264 cut off, null pointer crashes

Solution:
Check the pointer before using it

Verify:
T962X3-AB301

Change-Id: I49075e3f3d2018f70e19f356e577a80fd70cdb2f
Signed-off-by: apollo.ling <apollo.ling@amlogic.com>
drivers/frame_provider/decoder/h264_multi/vmh264.c

index 17318c7839c5688507e4f3ec091830b1d127d2de..320beb232ac3f1f880f22b53bf98d2fffcce30a5 100644 (file)
@@ -3040,10 +3040,12 @@ static int post_video_frame(struct vdec_s *vdec, struct FrameStore *frame)
                                vf->pts_us64 = 0;
                        }
 
-                       dpb_print(DECODE_ID(hw), PRINT_FLAG_DPB_DETAIL,
-                               "%s %d type = 0x%x pic_struct = %d pts = 0x%x pts_us64 = 0x%llx bForceInterlace = %d\n",
-                               __func__, __LINE__, vf->type, frame->frame->pic_struct,
-                               vf->pts, vf->pts_us64, bForceInterlace);
+                       if (frame->frame) {
+                               dpb_print(DECODE_ID(hw), PRINT_FLAG_DPB_DETAIL,
+                                       "%s %d type = 0x%x pic_struct = %d pts = 0x%x pts_us64 = 0x%llx bForceInterlace = %d\n",
+                                       __func__, __LINE__, vf->type, frame->frame->pic_struct,
+                                       vf->pts, vf->pts_us64, bForceInterlace);
+                       }
                }
                if (i == 0) {
                        struct vdec_s *pvdec;