1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-23 10:48:51 -05:00

Fix NULL pointer dereference

Calling glfwMakeContextCurrent with NULL would segfault since
496f559c9a.

Fixes #631.
Closes #632.
This commit is contained in:
Camilla Berglund 2015-10-31 18:21:21 +01:00
parent 3489b759a0
commit 6a41d5e7ad

View File

@ -543,7 +543,7 @@ GLFWAPI void glfwMakeContextCurrent(GLFWwindow* handle)
_GLFW_REQUIRE_INIT(); _GLFW_REQUIRE_INIT();
if (window->context.api == GLFW_NO_API) if (window && window->context.api == GLFW_NO_API)
{ {
_glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL); _glfwInputError(GLFW_NO_WINDOW_CONTEXT, NULL);
return; return;