From 6a41d5e7adb07373659716b26f0bd1fb09733b4d Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Sat, 31 Oct 2015 18:21:21 +0100 Subject: [PATCH] Fix NULL pointer dereference Calling glfwMakeContextCurrent with NULL would segfault since 496f559c9af3c1c600d134f0ad06929628a7f50c. Fixes #631. Closes #632. --- src/context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/context.c b/src/context.c index 36840e55..cda16d2d 100644 --- a/src/context.c +++ b/src/context.c @@ -543,7 +543,7 @@ GLFWAPI void glfwMakeContextCurrent(GLFWwindow* handle) _GLFW_REQUIRE_INIT(); - if (window->context.api == GLFW_NO_API) + if (window && window->context.api == GLFW_NO_API) { _glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL); return;