vulkan: Fix assignment of vkGetInstanceProcAddr on Windows.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 11 Feb 2018 18:16:01 -0500
changeset 118620f2ae46e429c
parent 11861 bd4899381cbd
child 11863 b3944d2ef793
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.
src/video/windows/SDL_windowsvulkan.c
     1.1 --- a/src/video/windows/SDL_windowsvulkan.c	Sat Feb 10 12:43:11 2018 -0800
     1.2 +++ b/src/video/windows/SDL_windowsvulkan.c	Sun Feb 11 18:16:01 2018 -0500
     1.3 @@ -57,7 +57,7 @@
     1.4          return -1;
     1.5      SDL_strlcpy(_this->vulkan_config.loader_path, path,
     1.6                  SDL_arraysize(_this->vulkan_config.loader_path));
     1.7 -    *(void**)vkGetInstanceProcAddr = SDL_LoadFunction(
     1.8 +    vkGetInstanceProcAddr = (PFN_vkGetInstanceProcAddr) SDL_LoadFunction(
     1.9          _this->vulkan_config.loader_handle, "vkGetInstanceProcAddr");
    1.10      if(!vkGetInstanceProcAddr)
    1.11          goto fail;