Skip to content

Commit 918e869

Browse files
TomCoocharles-lunarg
authored andcommitted
Fix assert in terminator_DestroySurfaceKHR
For an ICD without support for VK_KHR_surface the surface list pointer will be null. This change adds a check for VK_KHR_surface to avoid an abort when accessing the surface list.
1 parent abde4f3 commit 918e869

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

loader/wsi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,9 @@ VKAPI_ATTR void VKAPI_CALL terminator_DestroySurfaceKHR(VkInstance instance, VkS
323323
// The real_icd_surface for any ICD not supporting the
324324
// proper interface version should be NULL. If not, then
325325
// we have a problem.
326-
assert((VkSurfaceKHR)(uintptr_t)NULL == icd_term->surface_list.list[icd_surface->surface_index]);
326+
assert(!(icd_term->enabled_instance_extensions.khr_surface &&
327+
icd_term->scanned_icd->interface_version >= ICD_VER_SUPPORTS_ICD_SURFACE_KHR) ||
328+
(VkSurfaceKHR)(uintptr_t)NULL == icd_term->surface_list.list[icd_surface->surface_index]);
327329
}
328330
}
329331
if (NULL != icd_surface->create_info) {

0 commit comments

Comments
 (0)