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

Git pushed a commit to branch master
in repository ffmpeg.

commit 927f205eb8de44fc106a36f00ea9d713c813a4f3
Author:     Philip Langdale <[email protected]>
AuthorDate: Mon Jul 6 09:24:21 2026 -0700
Commit:     philipl <[email protected]>
CommitDate: Wed Jul 8 03:54:23 2026 +0000

    avutil/hwcontext_vulkan: fix CUDA interop for packed formats
    
    The current export_to_cuda logic only works for planar and semi-planar 
formats.
    When presented with a single plane packed format, it will incorrectly
    calculate the number of channels, resulting in failures later on when cuda
    code tries to access the frame. Let's fix it.
---
 libavutil/hwcontext_vulkan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 20b6ed46f8..467ae43b19 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -3871,6 +3871,7 @@ static int vulkan_export_to_cuda(AVHWFramesContext *hwfc,
     CudaFunctions *cu = cu_internal->cuda_dl;
     CUarray_format cufmt = desc->comp[0].depth > 8 ? 
CU_AD_FORMAT_UNSIGNED_INT16 :
                                                      
CU_AD_FORMAT_UNSIGNED_INT8;
+    const int elem_size = 1 + desc->comp[0].depth > 8;
 
     dst_f = (AVVkFrame *)frame->data[0];
     dst_int = dst_f->internal;
@@ -3915,7 +3916,7 @@ static int vulkan_export_to_cuda(AVHWFramesContext *hwfc,
                 .arrayDesc = {
                     .Depth = 0,
                     .Format = cufmt,
-                    .NumChannels = 1 + ((planes == 2) && i),
+                    .NumChannels = desc->comp[i].step / elem_size,
                     .Flags = 0,
                 },
                 .numLevels = 1,

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to