Skip to content

Commit

Permalink
Fix gamma test not checking for NULL return value
Browse files Browse the repository at this point in the history
  • Loading branch information
elmindreda committed Dec 31, 2021
1 parent 25c521c commit 8aaea57
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/gamma.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ int main(int argc, char** argv)

{
const GLFWgammaramp* ramp = glfwGetGammaRamp(monitor);
if (!ramp)
{
glfwTerminate();
exit(EXIT_FAILURE);
}

const size_t array_size = ramp->size * sizeof(short);
orig_ramp.size = ramp->size;
orig_ramp.red = malloc(array_size);
Expand Down

0 comments on commit 8aaea57

Please sign in to comment.