vulkan: Fix assignment of vkGetInstanceProcAddr on Windows.

"*(void**)pfn = LoadAddress()" would cast the NULL pointer in pfn to a
void**, and then dereference it, which wasn't what we wanted. Replaced with
a clearer cast operation.
This commit is contained in:
Ryan C. Gordon 2018-02-11 18:16:01 -05:00
parent 1143857d76
commit 882215e138
1 changed files with 1 additions and 1 deletions

View File

@ -57,7 +57,7 @@ int WIN_Vulkan_LoadLibrary(_THIS, const char *path)
return -1; return -1;
SDL_strlcpy(_this->vulkan_config.loader_path, path, SDL_strlcpy(_this->vulkan_config.loader_path, path,
SDL_arraysize(_this->vulkan_config.loader_path)); SDL_arraysize(_this->vulkan_config.loader_path));
*(void**)vkGetInstanceProcAddr = SDL_LoadFunction( vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr) SDL_LoadFunction(
_this->vulkan_config.loader_handle, "vkGetInstanceProcAddr"); _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr");
if(!vkGetInstanceProcAddr) if(!vkGetInstanceProcAddr)
goto fail; goto fail;