diff options
| author | Lenny Komow <lenny@lunarg.com> | 2017-09-12 22:54:21 -0600 |
|---|---|---|
| committer | Lenny Komow <lenny@lunarg.com> | 2017-09-13 11:21:11 -0600 |
| commit | 48128c402b023e66e0946dfe7efbf7e12ebffd5f (patch) | |
| tree | 9d09bc0302a384a5c939c9c5553788d34da2aa9f | |
| parent | 02feae3697826e1f202f654cdba99b015df373d2 (diff) | |
| download | usermoji-48128c402b023e66e0946dfe7efbf7e12ebffd5f.tar.xz | |
loader: Fix crash from loading invalid ICD
Addresses LunarXchange issue 711
Change-Id: Ia67441a3adde5ddf9d72ffd12c8cc5fb44071b96
| -rw-r--r-- | loader/loader.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/loader/loader.c b/loader/loader.c index 2fc394cb..6850153e 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -4935,6 +4935,9 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance(const VkInstanceCreateI goto out; } + // If any error happens after here, we need to remove the ICD from the list, + // because we've already added it, but haven't validated it + icd_create_info.enabledExtensionCount = 0; struct loader_extension_list icd_exts; @@ -5001,6 +5004,9 @@ VKAPI_ATTR VkResult VKAPI_CALL terminator_CreateInstance(const VkInstanceCreateI loader_log(ptr_instance, VK_DEBUG_REPORT_WARNING_BIT_EXT, 0, "terminator_CreateInstance: Failed to CreateInstance and find " "entrypoints with ICD. Skipping ICD."); + ptr_instance->icd_terms = icd_term->next; + icd_term->next = NULL; + loader_icd_destroy(ptr_instance, icd_term, pAllocator); continue; } |
