Skip to content

Commit 8aaea57

Browse files
committed
Fix gamma test not checking for NULL return value
1 parent 25c521c commit 8aaea57

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/gamma.c

+6
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,12 @@ int main(int argc, char** argv)
113113

114114
{
115115
const GLFWgammaramp* ramp = glfwGetGammaRamp(monitor);
116+
if (!ramp)
117+
{
118+
glfwTerminate();
119+
exit(EXIT_FAILURE);
120+
}
121+
116122
const size_t array_size = ramp->size * sizeof(short);
117123
orig_ramp.size = ramp->size;
118124
orig_ramp.red = malloc(array_size);

0 commit comments

Comments
 (0)