1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-22 18:28:52 -05:00

Fix gamma test not checking for NULL return value

This commit is contained in:
Camilla Löwy 2021-12-28 04:01:32 +01:00
parent 25c521cbe5
commit 8aaea57421

View File

@ -113,6 +113,12 @@ int main(int argc, char** argv)
{ {
const GLFWgammaramp* ramp = glfwGetGammaRamp(monitor); const GLFWgammaramp* ramp = glfwGetGammaRamp(monitor);
if (!ramp)
{
glfwTerminate();
exit(EXIT_FAILURE);
}
const size_t array_size = ramp->size * sizeof(short); const size_t array_size = ramp->size * sizeof(short);
orig_ramp.size = ramp->size; orig_ramp.size = ramp->size;
orig_ramp.red = malloc(array_size); orig_ramp.red = malloc(array_size);