From 135e1c0adf155419a9546f02d620fb2aae95194b Mon Sep 17 00:00:00 2001 From: Lynne Date: Sat, 20 Nov 2021 01:44:10 +0100 Subject: [PATCH] lavu/vulkan: check for initialization when freeing buffers What happens on startup is that ffmpeg.c initializes the filter, then frees it without feeding a single frame through. With no input frame, the filter lacks a hardware device. The rest of the uninit code checks if Vulkan objects exist, which they must if there's a hardware device, but vk->DeviceWaitIdle does not require an object. So, add a check for it. --- libavutil/vulkan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/vulkan.c b/libavutil/vulkan.c index a6463de622..00df08b55e 100644 --- a/libavutil/vulkan.c +++ b/libavutil/vulkan.c @@ -350,7 +350,7 @@ void ff_vk_free_buf(FFVulkanContext *s, FFVkBuffer *buf) { FFVulkanFunctions *vk = &s->vkfn; - if (!buf) + if (!buf || !s->hwctx) return; vk->DeviceWaitIdle(s->hwctx->act_dev);