radv: don't crash on null swapchain destroy.
authorDave Airlie <airlied@redhat.com>
Tue, 15 Nov 2016 20:11:51 +0000 (20:11 +0000)
committerDave Airlie <airlied@redhat.com>
Tue, 15 Nov 2016 23:18:03 +0000 (09:18 +1000)
Just return if the passed in swapchain is NULL.

Fixes: dEQP-VK.wsi.xlib.swapchain.destroy.null_handle
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_wsi.c

index a946bd4a8c5ad6cf1b9ef1be706571e6e7f3d373..1f1ab1c800ba53d51073e42c519e1d7e7f4d2440 100644 (file)
@@ -288,6 +288,9 @@ void radv_DestroySwapchainKHR(
        RADV_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain);
        const VkAllocationCallbacks *alloc;
 
+       if (!_swapchain)
+               return;
+
        if (pAllocator)
                alloc = pAllocator;
        else