diff mbox series

[FFmpeg-devel,v2,3/4] avutil/hwcontext_vulkan: check if created before destroying the instance

Message ID 20211124041154.1090109-3-jianhua.wu@intel.com
State New
Headers show
Series [FFmpeg-devel,v2,1/4] avutil/vulkan_functions: add EnumerateInstanceLayerProperties
Related show

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc success Make fate finished

Commit Message

Wu, Jianhua Nov. 24, 2021, 4:11 a.m. UTC
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
---
 libavutil/hwcontext_vulkan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavutil/hwcontext_vulkan.c b/libavutil/hwcontext_vulkan.c
index 4ac1058181..644ed947f8 100644
--- a/libavutil/hwcontext_vulkan.c
+++ b/libavutil/hwcontext_vulkan.c
@@ -1157,7 +1157,8 @@  static void vulkan_device_free(AVHWDeviceContext *ctx)
         vk->DestroyDebugUtilsMessengerEXT(hwctx->inst, p->debug_ctx,
                                           hwctx->alloc);
 
-    vk->DestroyInstance(hwctx->inst, hwctx->alloc);
+    if (hwctx->inst)
+        vk->DestroyInstance(hwctx->inst, hwctx->alloc);
 
     if (p->libvulkan)
         dlclose(p->libvulkan);