From: Pavel Asyutchenko Date: Tue, 23 Jun 2020 20:10:38 +0000 (+0300) Subject: vulkan/overlay: fix crash on destroying NULL swapchain X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ec7b55f4cc5dd3dc61eb6b9e51f46c58a2a896d3;p=mesa.git vulkan/overlay: fix crash on destroying NULL swapchain Cc: Reviewed-by: Lionel Landwerlin Part-of: --- 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);