This is an automated email from the git hooks/post-receive script. Git pushed a commit to branch release/8.1 in repository ffmpeg.
commit 48bcf28ab8a9e5cdb501c05d2d62d094102e9e3f Author: Philip Langdale <[email protected]> AuthorDate: Mon Jul 6 12:36:02 2026 -0700 Commit: Michael Niedermayer <[email protected]> CommitDate: Sat Nov 28 09:24:23 2026 +0100 avutil/hwcontext_vulkan: reject unsupported semi-planar CUDA imports Cuda currently only supports packed and single-component planar formats, but fails to import semi-planer (eg: NV12, P010). Even though there are now semi-planar cuda array formats, which the latest nvdec can use, these formats are not used when mapping Vulkan imports. Maybe they'll fix that some day. But until then, let's explicitly detect the case and return a clear error message for the user. Exercising this error path revealed that vulkan_free_internal() frees f->internal on a transfer error and then runs again when the frame is destroyed, dereferencing the freed pointer; let's make it idempotent. (cherry picked from commit c29d710cd5d0f80bbb56f7ec1f35d5fb7ed44d05) Signed-off-by: Michael Niedermayer <[email protected]> --- libavutil/hwcontext_vulkan.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c index 963b7ceed7..48822a5825 100644 --- a/libavutil/hwcontext_vulkan.c +++ b/libavutil/hwcontext_vulkan.c @@ -2427,6 +2427,10 @@ static void vulkan_free_internal(VulkanDevicePriv *p, AVVkFrame *f) { av_unused AVVkFrameInternal *internal = f->internal; + // Make this function safe to call repeatedly + if (!internal) + return; + #if CONFIG_CUDA vulkan_free_internal_cuda(internal); #endif @@ -3980,6 +3984,18 @@ static int vulkan_export_to_cuda(AVHWFramesContext *hwfc, if (nb_images != planes) { for (int i = 0; i < planes; i++) { + /* Cuda now defines array formats for semi-planar, but these are + * not currently supported for imported Vulkan images. */ + if (desc->comp[i].step / elem_size > 1) { + av_log(ctx, AV_LOG_ERROR, + "Cannot map a multiplane Vulkan image (%d image(s) " + "for %d plane(s)) to CUDA; create the Vulkan device " + "with the disable_multiplane=1 option (one image per " + "plane) for CUDA interop.\n", nb_images, planes); + err = AVERROR(ENOSYS); + goto fail; + } + VkImageSubresource subres = { .aspectMask = i == 2 ? VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT : i == 1 ? VK_IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT : -- 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]
