diff options
author | Charles Giessen <charles@lunarg.com> | 2022-05-03 22:28:57 +0300 |
---|---|---|
committer | Charles Giessen <46324611+charles-lunarg@users.noreply.github.com> | 2022-05-03 22:39:00 +0300 |
commit | 36a82e0de8ef85b96797ac51f1ba1b97618ed0f7 (patch) | |
tree | 7664e689e13742b15846bcbbb550138f27e4490f | |
parent | 191e2614953908c5829d7826a5ac5265e4ad2a03 (diff) |
Correctly check for NULL in loader_get_dispatch
-rw-r--r-- | loader/loader.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/loader/loader.h b/loader/loader.h index 48faed94b..566692ff9 100644 --- a/loader/loader.h +++ b/loader/loader.h @@ -42,8 +42,11 @@ static inline VkPhysicalDevice loader_unwrap_physical_device(VkPhysicalDevice ph static inline void loader_set_dispatch(void *obj, const void *data) { *((const void **)obj) = data; } static inline VkLayerDispatchTable *loader_get_dispatch(const void *obj) { + if (VK_NULL_HANDLE == obj) { + return NULL; + } VkLayerDispatchTable *disp = *((VkLayerDispatchTable **)obj); - if (VK_NULL_HANDLE == obj || DEVICE_DISP_TABLE_MAGIC_NUMBER != disp->magic) { + if (VK_NULL_HANDLE == disp || DEVICE_DISP_TABLE_MAGIC_NUMBER != disp->magic) { return NULL; } return disp; |