[FFmpeg-cvslog] lavu/vulkan: check for initialization when freeing buffers
Lynne
git at videolan.org
Sat Nov 20 02:49:01 EET 2021
ffmpeg | branch: master | Lynne <dev at lynne.ee> | Sat Nov 20 01:44:10 2021 +0100| [135e1c0adf155419a9546f02d620fb2aae95194b] | committer: Lynne
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.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=135e1c0adf155419a9546f02d620fb2aae95194b
---
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);
More information about the ffmpeg-cvslog
mailing list