From: He Junyan Date: Thu, 24 Mar 2022 13:39:30 +0000 (+0800) Subject: va: h265dec: Fix a crash because of missing reference frame. X-Git-Tag: 1.22.0~2043 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b2a00dff07fa134bbb55f4fd914b13fb353cc9fa;p=platform%2Fupstream%2Fgstreamer.git va: h265dec: Fix a crash because of missing reference frame. Some problematic H265 stream may miss the reference frame in the DPB, and get some message like: "No short term reference picture for xxx". So there may be empty entries in ref_pic_list0/1 when passing to decode_slice() function of sub class. We need to check the NULL pointer. Part-of: --- diff --git a/subprojects/gst-plugins-bad/sys/va/gstvah265dec.c b/subprojects/gst-plugins-bad/sys/va/gstvah265dec.c index 05d55fc..4494446 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvah265dec.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvah265dec.c @@ -315,6 +315,9 @@ _get_reference_index (GstH265Decoder * decoder, GstH265Picture * picture) GstVaH265Dec *self = GST_VA_H265_DEC (decoder); guint8 i; + if (!picture) + return 0xFF; + for (i = 0; i < 15; i++) { VAPictureHEVC *ref_va_pic = &self->pic_param.base.ReferenceFrames[i];