From 34b1d195b7360fba6d70adb12072f1d25d377c8a Mon Sep 17 00:00:00 2001 From: Xu Guangxin Date: Thu, 6 Aug 2020 12:51:27 +0800 Subject: [PATCH] h264dec: mark remaining frames as unreference before exec_picture_refs_modification 8.2.4.2 required this. Some clips will crash if we do not fill the reference list like this. Part-of: --- gst-libs/gst/vaapi/gstvaapidecoder_h264.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c index 7dd7ed7fee..fd57a3f0b4 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c @@ -3099,8 +3099,6 @@ init_picture_refs (GstVaapiDecoderH264 * decoder, break; } - ret = ret && exec_picture_refs_modification (decoder, picture, slice_hdr); - switch (slice_hdr->type % 5) { case GST_H264_B_SLICE: num_refs = 1 + slice_hdr->num_ref_idx_l1_active_minus1; @@ -3120,6 +3118,8 @@ init_picture_refs (GstVaapiDecoderH264 * decoder, break; } + ret = ret && exec_picture_refs_modification (decoder, picture, slice_hdr); + mark_picture_refs (decoder, picture); return ret;