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
No known key found for this signature in database
GPG Key ID: A2FEA5F03F034464
1 changed files with 1 additions and 1 deletions

View File

@ -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);