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

Git pushed a commit to branch release/9.0
in repository ffmpeg.

commit f1137f107412d213965c04a634d32c2b795137b2
Author:     Philip Langdale <[email protected]>
AuthorDate: Mon Jul 6 09:24:21 2026 -0700
Commit:     Lynne <[email protected]>
CommitDate: Sun Jul 12 13:47:24 2026 +0900

    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.
    
    (cherry picked from commit 927f205eb8de44fc106a36f00ea9d713c813a4f3)
---
 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