This is an error case where the I field has no reference, however
the reference list contains some reference, which resulting in
not be able to find its reference, and it is a correct behavior,
should not enter the correction code. Just add this exception to
prevent such a case, if more exceptions found, they will
be treated indiviually in the future.
Cc: mesa-stable
closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8740
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Signed-off-by: David (Ming Qiang) Wu <David.Wu3@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22485>
/* if reference picture exists, however no reference picture found at the end
curr_pic_ref_frame_num == 0, which is not reasonable, should be corrected. */
- if (result.used_for_reference_flags && (result.curr_pic_ref_frame_num == 0)) {
+ /* one exeption for I frames which is valid situation and should be skipped. */
+ if ((result.curr_field_order_cnt_list[0] == result.curr_field_order_cnt_list[1])
+ && result.used_for_reference_flags && (result.curr_pic_ref_frame_num == 0)) {
for (i = 0; i < ARRAY_SIZE(result.ref_frame_list); i++) {
result.ref_frame_list[i] = pic->ref[i] ?
(uintptr_t)vl_video_buffer_get_associated_data(pic->ref[i], &dec->base) : 0xff;