Skip to content

Commit ab7f331

Browse files
committed
Dont crash if XRRGetCrtcInfo() returns NULL
1 parent e5a720c commit ab7f331

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

glfw/x11_monitor.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ void _glfwPollMonitorsX11(void)
152152
}
153153

154154
ci = XRRGetCrtcInfo(_glfw.x11.display, sr, oi->crtc);
155+
if (!ci)
156+
{
157+
XRRFreeOutputInfo(oi);
158+
continue;
159+
}
155160
if (ci->rotation == RR_Rotate_90 || ci->rotation == RR_Rotate_270)
156161
{
157162
widthMM = oi->mm_height;
@@ -501,4 +506,3 @@ GLFWAPI RROutput glfwGetX11Monitor(GLFWmonitor* handle)
501506
_GLFW_REQUIRE_INIT_OR_RETURN(None);
502507
return monitor->x11.output;
503508
}
504-

0 commit comments

Comments
 (0)