From 84b71605352286c8a99ae79b8057b50996a8618f Mon Sep 17 00:00:00 2001 From: miaohong chen Date: Tue, 29 Sep 2020 10:17:51 +0800 Subject: [PATCH] vmh264: h264 stream crash when enable debug [1/1] PD#SWPL-34375 Problem: Null pointer access lead to crash Solution: Add Null pointer detect Verify: U212 Change-Id: I9d54d7640dd435b1a47823c26e878441ad05e31a Signed-off-by: miaohong chen --- .../decoder/h264_multi/h264_dpb.c | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/frame_provider/decoder/h264_multi/h264_dpb.c b/drivers/frame_provider/decoder/h264_multi/h264_dpb.c index 43d4719..ae485a9 100644 --- a/drivers/frame_provider/decoder/h264_multi/h264_dpb.c +++ b/drivers/frame_provider/decoder/h264_multi/h264_dpb.c @@ -2690,12 +2690,17 @@ void dump_dpb(struct DecodedPictureBuffer *p_Dpb, u8 force) "B: poc=%d ", p_Dpb->fs[i]->frame->bottom_poc); } - if (p_Dpb->fs[i]->is_used == 3) - dpb_print_cont(p_H264_Dpb->decoder_index, - 0, - "F: poc=%d pic_num=%d ", - p_Dpb->fs[i]->frame->poc, - p_Dpb->fs[i]->frame->pic_num); + if (p_Dpb->fs[i]->is_used == 3) { + if (p_Dpb->fs[i]->frame != NULL) + dpb_print_cont(p_H264_Dpb->decoder_index, + 0, + "F: poc=%d pic_num=%d ", + p_Dpb->fs[i]->frame->poc, + p_Dpb->fs[i]->frame->pic_num); + else + dpb_print_cont(p_H264_Dpb->decoder_index, + 0, "fs[%d] frame is null ", i); + } dpb_print_cont(p_H264_Dpb->decoder_index, 0, "G: poc=%d) ", p_Dpb->fs[i]->poc); @@ -2716,10 +2721,13 @@ void dump_dpb(struct DecodedPictureBuffer *p_Dpb, u8 force) 0, "pre_output(in dispq or displaying) "); if (p_Dpb->fs[i]->is_used == 3) { - if (p_Dpb->fs[i]->frame->non_existing) + if (p_Dpb->fs[i]->frame != NULL && p_Dpb->fs[i]->frame->non_existing) dpb_print_cont(p_H264_Dpb->decoder_index, 0, "non_existing "); + else + dpb_print_cont(p_H264_Dpb->decoder_index, + 0, "fs[%d] frame is null ", i); } dpb_print_cont(p_H264_Dpb->decoder_index, 0, -- 2.20.1