Commit 967f0ffb10 for ffmpeg
commit 967f0ffb10c3e77cfb8f7e1ba1cbed2e0a29d127
Author: Tim Blechmann <tim@klingt.org>
Date: Tue Sep 22 11:40:08 2026 +0800
avutil/vulkan: avoid crash on null vkGetDeviceQueue2
vkGetDeviceQueue2 is core since Vulkan 1.1 and is always loaded by
ff_vk_load_functions() regardless of which extensions are enabled, but
some drivers/loaders can still return a non-functional dispatch entry
for it depending on how the instance/device were set up (e.g. an
imported device from an app that declared an insufficient
VkApplicationInfo::apiVersion). Calling it then crashes instead of
failing cleanly. Guard the call and return AVERROR_EXTERNAL if the
function pointer is unavailable.
diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c
index 6d5038a584..76e9a773a5 100644
--- a/libavutil/vulkan.c
+++ b/libavutil/vulkan.c
@@ -585,6 +585,10 @@ int ff_vk_exec_pool_init(FFVulkanContext *s, AVVulkanDeviceQueueFamily *qf,
.queueFamilyIndex = qf->idx,
.queueIndex = e->qi,
};
+ if (!vk->GetDeviceQueue2) {
+ av_log(s, AV_LOG_ERROR, "vkGetDeviceQueue2 is unavailable on this device\n");
+ return AVERROR_EXTERNAL;
+ }
vk->GetDeviceQueue2(s->hwctx->act_dev, &qinfo, &e->queue);
}