diff options
author | Wu Jianhua <jianhua.wu@intel.com> | 2021-11-24 12:11:53 +0800 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2021-11-24 11:09:49 +0100 |
commit | 7e9e2cf93b6e22eaec72837ab59ac654c19b8d99 (patch) | |
tree | 97d78561431a9ac627b390e2232db1edd468ce26 | |
parent | c2a356d5835b62c6f4a9263ac9c917d6a31fe431 (diff) | |
download | ffmpeg-7e9e2cf93b6e22eaec72837ab59ac654c19b8d99.tar.gz |
avutil/hwcontext_vulkan: check if created before destroying the instance
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
-rw-r--r-- | libavutil/hwcontext_vulkan.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); |