From f9bdce61e10885e64eb09189ce10d5ec5ae8871d Mon Sep 17 00:00:00 2001 From: John Bartholomew Date: Sun, 14 Jan 2018 13:34:50 +0000 Subject: [PATCH] Vulkan: Allow SDL_Vulkan_GetInstanceExtensions to be called with a larger array than necessary. --- src/video/SDL_vulkan_utils.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/video/SDL_vulkan_utils.c b/src/video/SDL_vulkan_utils.c index ae6bbf54b..9228378fa 100644 --- a/src/video/SDL_vulkan_utils.c +++ b/src/video/SDL_vulkan_utils.c @@ -156,10 +156,10 @@ SDL_bool SDL_Vulkan_GetInstanceExtensions_Helper(unsigned *userCount, { unsigned int i; - if(*userCount != nameCount) + if(*userCount < nameCount) { SDL_SetError( - "Count doesn't match count from previous call of SDL_Vulkan_GetInstanceExtensions"); + "Ouput array for SDL_Vulkan_GetInstanceExtensions is too small"); return SDL_FALSE; } for(i = 0; i < nameCount; i++) @@ -167,10 +167,7 @@ SDL_bool SDL_Vulkan_GetInstanceExtensions_Helper(unsigned *userCount, userNames[i] = names[i]; } } - else - { - *userCount = nameCount; - } + *userCount = nameCount; return SDL_TRUE; }