Skip to content

Commit 09a024d

Browse files
Check for nullptr in loader_unwrap_physical_device
Makes sure nullptr's are checked before dereferencing it to check if the magic value is correct.
1 parent a3d9775 commit 09a024d

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

loader/loader.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
LOADER_PLATFORM_THREAD_ONCE_EXTERN_DEFINITION(once_init)
3737

3838
static inline VkPhysicalDevice loader_unwrap_physical_device(VkPhysicalDevice physicalDevice) {
39+
if (VK_NULL_HANDLE == physicalDevice) {
40+
return VK_NULL_HANDLE;
41+
}
3942
struct loader_physical_device_tramp *phys_dev = (struct loader_physical_device_tramp *)physicalDevice;
4043
if (PHYS_TRAMP_MAGIC_NUMBER != phys_dev->magic) {
4144
return VK_NULL_HANDLE;

0 commit comments

Comments
 (0)