diff options
author | Danny Zhu <danny@netflt.com> | 2022-10-25 17:30:29 +0300 |
---|---|---|
committer | Charles Giessen <46324611+charles-lunarg@users.noreply.github.com> | 2022-10-25 18:08:22 +0300 |
commit | c2d94e9c83cc4e6bb605fbcfb7bbf2a62db8d0f9 (patch) | |
tree | 58cbd2578973cf1b08ff29607690777bc126f57b | |
parent | 7626527833c7bc1b28a80b6dfbd0e8506fc41339 (diff) |
fix: add null pointer checking
-rw-r--r-- | loader/loader.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/loader/loader.c b/loader/loader.c index 84031dfb4..00a0273da 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -4307,9 +4307,12 @@ VKAPI_ATTR void VKAPI_CALL loader_layer_destroy_device(VkDevice device, const Vk const struct loader_instance *inst = icd_term->this_instance; destroyFunction(device, pAllocator); - dev->chain_device = NULL; - dev->icd_device = NULL; - loader_remove_logical_device(inst, icd_term, dev, pAllocator); + if (NULL != dev) + { + dev->chain_device = NULL; + dev->icd_device = NULL; + loader_remove_logical_device(inst, icd_term, dev, pAllocator); + } } // Given the list of layers to activate in the loader_instance |