[Commits] SDL: vulkan: Fix assignment of vkGetInstanceProcAddr on Windows.

libsdl.org revision control commits-owner at libsdl.org
Sun Feb 11 15:16:25 PST 2018


details:   https://hg.libsdl.org/SDL/rev/0f2ae46e429c
changeset: 11862:0f2ae46e429c
user:      Ryan C. Gordon <icculus at icculus.org>
date:      Sun Feb 11 18:16:01 2018 -0500
description:
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.

diffstat:

 src/video/windows/SDL_windowsvulkan.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff -r bd4899381cbd -r 0f2ae46e429c src/video/windows/SDL_windowsvulkan.c
--- a/src/video/windows/SDL_windowsvulkan.c	Sat Feb 10 12:43:11 2018 -0800
+++ b/src/video/windows/SDL_windowsvulkan.c	Sun Feb 11 18:16:01 2018 -0500
@@ -57,7 +57,7 @@
         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;


More information about the commits mailing list