summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorWu Jianhua <jianhua.wu@intel.com>2021-11-24 12:11:52 +0800
committerLynne <dev@lynne.ee>2021-11-24 11:09:49 +0100
commitc2a356d5835b62c6f4a9263ac9c917d6a31fe431 (patch)
treeb02710c94cb8096c9cd9c8e793cd42cfaa05468f /libavutil
parent9dd104f6e263dce770541074d99b5286524f2a8b (diff)
downloadffmpeg-c2a356d5835b62c6f4a9263ac9c917d6a31fe431.tar.gz
avutil/hwcontext_vulkan: check if created before destroying the device
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/hwcontext_vulkan.c3
1 files changed, 2 insertions, 1 deletions
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,