1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-15 14:13:16 +02:00

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.
This commit is contained in:
Lynne
2021-11-20 01:44:10 +01:00
parent a132614bba
commit 135e1c0adf

View File

@@ -350,7 +350,7 @@ void ff_vk_free_buf(FFVulkanContext *s, FFVkBuffer *buf)
{ {
FFVulkanFunctions *vk = &s->vkfn; FFVulkanFunctions *vk = &s->vkfn;
if (!buf) if (!buf || !s->hwctx)
return; return;
vk->DeviceWaitIdle(s->hwctx->act_dev); vk->DeviceWaitIdle(s->hwctx->act_dev);