From 9ab14a8cc099d9aeda5bbd418772a65a2dd8bce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 28 Dec 2021 04:01:32 +0100 Subject: [PATCH] Fix gamma test not checking for NULL return value (cherry picked from commit 8aaea57421cd4e37b439fbce7482a5f351c0c31f) --- tests/gamma.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/gamma.c b/tests/gamma.c index aa4c8b78..7419592f 100644 --- a/tests/gamma.c +++ b/tests/gamma.c @@ -111,6 +111,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);