From aba5ea7f5f10a55ad9d1f4eb09c364e3fe07fb02 Mon Sep 17 00:00:00 2001 From: zhongcong Date: Tue, 14 May 2013 16:43:18 +0800 Subject: [PATCH] h264: fix modification process of reference picture list error --- gst-libs/gst/vaapi/gstvaapidecoder_h264.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c index d2cfb17..f3eb62a 100755 --- a/gst-libs/gst/vaapi/gstvaapidecoder_h264.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_h264.c @@ -2334,8 +2334,6 @@ exec_picture_refs_modification_1( num_refs = slice_hdr->num_ref_idx_l1_active_minus1 + 1; } ref_list_count = *ref_list_count_ptr; - if (num_refs > ref_list_count) - num_refs = ref_list_count; if (!GST_VAAPI_PICTURE_IS_FRAME(picture)) { MaxPicNum = 1 << (sps->log2_max_frame_num_minus4 + 5); // 2 * MaxFrameNum @@ -2479,7 +2477,9 @@ exec_picture_refs_modification_1( if (!ref_list[i]) GST_ERROR("list %u entry %u is empty", list, i); #endif - *ref_list_count_ptr = num_refs; + + for(i = num_refs; i > 0 && !ref_list[i - 1]; i--); + *ref_list_count_ptr = i ; } /* 8.2.4.3 - Modification process for reference picture lists */ -- 1.7.9.5