Dont crash if XRRGetCrtcInfo() returns NULL

This commit is contained in:
Kovid Goyal 2018-08-03 16:17:25 +05:30
parent e5a720c6fa
commit ab7f3310c4
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

6
glfw/x11_monitor.c vendored
View File

@ -152,6 +152,11 @@ void _glfwPollMonitorsX11(void)
}
ci = XRRGetCrtcInfo(_glfw.x11.display, sr, oi->crtc);
if (!ci)
{
XRRFreeOutputInfo(oi);
continue;
}
if (ci->rotation == RR_Rotate_90 || ci->rotation == RR_Rotate_270)
{
widthMM = oi->mm_height;
@ -501,4 +506,3 @@ GLFWAPI RROutput glfwGetX11Monitor(GLFWmonitor* handle)
_GLFW_REQUIRE_INIT_OR_RETURN(None);
return monitor->x11.output;
}