mirror of
https://github.com/glfw/glfw.git
synced 2026-08-28 11:25:53 +02:00
Fix NULL pointer dereference
Calling glfwMakeContextCurrent with NULL would segfault since
496f559c9a.
Fixes #631.
Closes #632.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user