mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-16 11:06:49 +01:00
Vulkan: Allow SDL_Vulkan_GetInstanceExtensions to be called with a larger array than necessary.
This commit is contained in:
parent
7cd39b7d15
commit
f9bdce61e1
@ -156,10 +156,10 @@ SDL_bool SDL_Vulkan_GetInstanceExtensions_Helper(unsigned *userCount,
|
|||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
if(*userCount != nameCount)
|
if(*userCount < nameCount)
|
||||||
{
|
{
|
||||||
SDL_SetError(
|
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;
|
return SDL_FALSE;
|
||||||
}
|
}
|
||||||
for(i = 0; i < nameCount; i++)
|
for(i = 0; i < nameCount; i++)
|
||||||
@ -167,10 +167,7 @@ SDL_bool SDL_Vulkan_GetInstanceExtensions_Helper(unsigned *userCount,
|
|||||||
userNames[i] = names[i];
|
userNames[i] = names[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
*userCount = nameCount;
|
||||||
{
|
|
||||||
*userCount = nameCount;
|
|
||||||
}
|
|
||||||
return SDL_TRUE;
|
return SDL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user