anv: handle negative value of slot index for h265 decoding.

Fixes: 8d519eb5 ("anv: add initial video decode support for h265")
Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 5ecea6ec4a)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33113>
This commit is contained in:
Hyunjun Ko
2025-01-03 10:22:08 +09:00
committed by Dylan Baker
parent e8fdb9fe5c
commit 0d5f54b5ca
2 changed files with 4 additions and 1 deletions

View File

@@ -343,6 +343,9 @@ anv_h265_decode_video(struct anv_cmd_buffer *cmd_buffer,
int slot_idx = frame_info->pReferenceSlots[i].slotIndex;
assert(slot_idx < ANV_VIDEO_H265_MAX_NUM_REF_FRAME);
if (slot_idx < 0)
continue;
dpb_idx[slot_idx] = i;
buf.ReferencePictureAddress[i] =