From ec7b55f4cc5dd3dc61eb6b9e51f46c58a2a896d3 Mon Sep 17 00:00:00 2001 From: Pavel Asyutchenko Date: Tue, 23 Jun 2020 23:10:38 +0300 Subject: [PATCH] vulkan/overlay: fix crash on destroying NULL swapchain Cc: Reviewed-by: Lionel Landwerlin Part-of: --- src/vulkan/overlay-layer/overlay.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vulkan/overlay-layer/overlay.cpp b/src/vulkan/overlay-layer/overlay.cpp index 1ed1d2b02e7..c415d6a8205 100644 --- a/src/vulkan/overlay-layer/overlay.cpp +++ b/src/vulkan/overlay-layer/overlay.cpp @@ -1861,6 +1861,12 @@ static void overlay_DestroySwapchainKHR( VkSwapchainKHR swapchain, const VkAllocationCallbacks* pAllocator) { + if (swapchain == VK_NULL_HANDLE) { + struct device_data *device_data = FIND(struct device_data, device); + device_data->vtable.DestroySwapchainKHR(device, swapchain, pAllocator); + return; + } + struct swapchain_data *swapchain_data = FIND(struct swapchain_data, swapchain); -- 2.30.2