[FFmpeg-cvslog] avutil/hwcontext_vulkan: check if created before destroying the device

Wu Jianhua git at videolan.org
Wed Nov 24 12:21:26 EET 2021


ffmpeg | branch: master | Wu Jianhua <jianhua.wu at intel.com> | Wed Nov 24 12:11:52 2021 +0800| [c2a356d5835b62c6f4a9263ac9c917d6a31fe431] | committer: Lynne

avutil/hwcontext_vulkan: check if created before destroying the device

Signed-off-by: Wu Jianhua <jianhua.wu at intel.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c2a356d5835b62c6f4a9263ac9c917d6a31fe431
---

 libavutil/hwcontext_vulkan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index f1e750cd3e..4ac1058181 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -1150,7 +1150,8 @@ static void vulkan_device_free(AVHWDeviceContext *ctx)
     FFVulkanFunctions *vk = &p->vkfn;
     AVVulkanDeviceContext *hwctx = ctx->hwctx;
 
-    vk->DestroyDevice(hwctx->act_dev, hwctx->alloc);
+    if (hwctx->act_dev)
+        vk->DestroyDevice(hwctx->act_dev, hwctx->alloc);
 
     if (p->debug_ctx)
         vk->DestroyDebugUtilsMessengerEXT(hwctx->inst, p->debug_ctx,



More information about the ffmpeg-cvslog mailing list