summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_wsi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/intel/vulkan/anv_wsi.c')
-rw-r--r--src/intel/vulkan/anv_wsi.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c
index b95e965..c504658 100644
--- a/src/intel/vulkan/anv_wsi.c
+++ b/src/intel/vulkan/anv_wsi.c
@@ -76,6 +76,9 @@ void anv_DestroySurfaceKHR(
ANV_FROM_HANDLE(anv_instance, instance, _instance);
ANV_FROM_HANDLE(_VkIcdSurfaceBase, surface, _surface);
+ if (!surface)
+ return;
+
vk_free2(&instance->alloc, pAllocator, surface);
}
@@ -294,6 +297,9 @@ void anv_DestroySwapchainKHR(
ANV_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain);
const VkAllocationCallbacks *alloc;
+ if (!swapchain)
+ return;
+
if (pAllocator)
alloc = pAllocator;
else