mirror of
https://github.com/glfw/glfw.git
synced 2024-11-29 07:34:35 +00:00
Fix NULL pointer dereference
Calling glfwMakeContextCurrent with NULL would segfault since
496f559c9a
.
Fixes #631.
Closes #632.
This commit is contained in:
parent
3489b759a0
commit
6a41d5e7ad
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user