Skip to content

Commit

Permalink
Vulkan: Allow SDL_Vulkan_GetInstanceExtensions to be called with a la…
Browse files Browse the repository at this point in the history
…rger array than necessary.
  • Loading branch information
johnbartholomew committed Jan 14, 2018
1 parent 7cd39b7 commit f9bdce6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/video/SDL_vulkan_utils.c
Expand Up @@ -156,21 +156,18 @@ 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++)
{
userNames[i] = names[i];
}
}
else
{
*userCount = nameCount;
}
*userCount = nameCount;
return SDL_TRUE;
}

Expand Down

0 comments on commit f9bdce6

Please sign in to comment.