aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLynne <dev@lynne.ee>2021-11-20 01:44:10 +0100
committerLynne <dev@lynne.ee>2021-11-20 01:48:45 +0100
commit135e1c0adf155419a9546f02d620fb2aae95194b (patch)
tree3efbe61c7058d079bfabb9b285690f70302ac29d
parenta132614bba247afac30d3a8b1378c40bd7f672bc (diff)
downloadffmpeg-135e1c0adf155419a9546f02d620fb2aae95194b.tar.gz
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.
-rw-r--r--libavutil/vulkan.c2
1 files changed, 1 insertions, 1 deletions
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);