From ab7f3310c4f7982026a897155eabb097683658b2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 3 Aug 2018 16:17:25 +0530 Subject: [PATCH] Dont crash if XRRGetCrtcInfo() returns NULL --- glfw/x11_monitor.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/glfw/x11_monitor.c b/glfw/x11_monitor.c index f557fe472..1c115e0ea 100644 --- a/glfw/x11_monitor.c +++ b/glfw/x11_monitor.c @@ -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; } -