This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 0ae15fffefd66d78828902176da25d19ae652a0e
Author:     Lynne <[email protected]>
AuthorDate: Tue Sep 8 10:15:13 2026 +0900
Commit:     Lynne <[email protected]>
CommitDate: Sun Sep 20 14:45:50 2026 +0900

    vulkan_decode: do not bind the current picture twice when its slot is active
    
    When decoding the second field of a pair, the picture is already bound as
    an active reference at its DPB slot, since the first field made it one.
    Appending it again as an inactive slot duplicates the picture resource
    within the coding scope, which is not allowed
    (VUID-vkCmdBeginVideoCodingKHR-pPictureResource-07238).
---
 libavcodec/vulkan_decode.c | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/libavcodec/vulkan_decode.c b/libavcodec/vulkan_decode.c
index 2ee78a3fba..961a62fbb7 100644
--- a/libavcodec/vulkan_decode.c
+++ b/libavcodec/vulkan_decode.c
@@ -460,12 +460,19 @@ int ff_vk_decode_frame(AVCodecContext *avctx,
 
     FFVkExecContext *exec = ff_vk_exec_get(&ctx->s, &ctx->exec_pool);
 
-    /* The current decoding reference has to be bound as an inactive reference 
*/
-    VkVideoReferenceSlotInfoKHR *cur_vk_ref;
-    cur_vk_ref = (void 
*)&decode_start.pReferenceSlots[decode_start.referenceSlotCount];
-    cur_vk_ref[0] = vp->ref_slot;
-    cur_vk_ref[0].slotIndex = -1;
-    decode_start.referenceSlotCount++;
+    /* The current picture's resource has to be bound as an inactive
+     * reference, unless its slot is already bound as an active one, as when
+     * decoding the second field of a pair. */
+    int cur_bound = 0;
+    for (int i = 0; i < decode_start.referenceSlotCount; i++)
+        cur_bound |= decode_start.pReferenceSlots[i].slotIndex == 
vp->ref_slot.slotIndex;
+    if (!cur_bound) {
+        VkVideoReferenceSlotInfoKHR *cur_vk_ref;
+        cur_vk_ref = (void 
*)&decode_start.pReferenceSlots[decode_start.referenceSlotCount];
+        cur_vk_ref[0] = vp->ref_slot;
+        cur_vk_ref[0].slotIndex = -1;
+        decode_start.referenceSlotCount++;
+    }
 
     sd_buf = vp->slices_buf;
 

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to