[Mesa-dev] [PATCH] radv: don't crash on null swapchain destroy.

Dave Airlie airlied at gmail.com
Tue Nov 15 20:12:52 UTC 2016


From: Dave Airlie <airlied at redhat.com>

Just return if the passed in swapchain is NULL.

Fixes: dEQP-VK.wsi.xlib.swapchain.destroy.null_handle

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/amd/vulkan/radv_wsi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c
index a946bd4..1f1ab1c 100644
--- a/src/amd/vulkan/radv_wsi.c
+++ b/src/amd/vulkan/radv_wsi.c
@@ -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
-- 
2.7.4



More information about the mesa-dev mailing list