Skip to content

Commit

Permalink
vulkan: Fix assignment of vkGetInstanceProcAddr on Windows.
Browse files Browse the repository at this point in the history
"*(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.
  • Loading branch information
icculus committed Feb 11, 2018
1 parent 1143857 commit 882215e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/video/windows/SDL_windowsvulkan.c
Expand Up @@ -57,7 +57,7 @@ int WIN_Vulkan_LoadLibrary(_THIS, const char *path)
return -1;
SDL_strlcpy(_this->vulkan_config.loader_path, path,
SDL_arraysize(_this->vulkan_config.loader_path));
*(void**)vkGetInstanceProcAddr = SDL_LoadFunction(
vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr) SDL_LoadFunction(
_this->vulkan_config.loader_handle, "vkGetInstanceProcAddr");
if(!vkGetInstanceProcAddr)
goto fail;
Expand Down

0 comments on commit 882215e

Please sign in to comment.