1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avutil/hwcontext_vulkan: check if created before destroying the device

Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
This commit is contained in:
Wu Jianhua 2021-11-24 12:11:52 +08:00 committed by Lynne
parent 9dd104f6e2
commit c2a356d583

View File

@ -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,