vdec: check the pointer before using it [1/1]
authorapollo.ling <apollo.ling@amlogic.com>
Thu, 24 Dec 2020 12:15:19 +0000 (20:15 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Fri, 25 Dec 2020 08:01:26 +0000 (00:01 -0800)
PD#SWPL-38329

Problem:
play special stream,DUT reboot when stream replay

Solution:
Check the pointer before using it

Verify:
ah212

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

index 874b5f37ffb1f44f2f4d5d9175ca855c903b0d12..523ce9f5aec1af18e5589f8a584412e6644ca287 100644 (file)
@@ -5313,9 +5313,10 @@ static void reorder_lists(struct Slice *currSlice)
                        PRINT_FLAG_DPB_DETAIL,
                                  "listX[1] reorder (PicNum): ");
                        for (i = 0; i < currSlice->listXsize[1]; i++) {
-                               dpb_print_cont(p_H264_Dpb->decoder_index,
-                                       PRINT_FLAG_DPB_DETAIL, "%d  ",
-                                       currSlice->listX[1][i]->pic_num);
+                               if (currSlice->listX[1][i])
+                                       dpb_print_cont(p_H264_Dpb->decoder_index,
+                                               PRINT_FLAG_DPB_DETAIL, "%d  ",
+                                               currSlice->listX[1][i]->pic_num);
                        }
                        dpb_print_cont(p_H264_Dpb->decoder_index,
                                PRINT_FLAG_DPB_DETAIL, "\n");