From 9fa56176fd5c95b609cc52b594baa47880961aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Wed, 26 Feb 2020 16:10:12 +0100 Subject: monitor-manager-xrandr: Don't try to disable disabled CRTC When applying a configuration to XRANDR, we first disable CRTCs that happen to extend outside of the to-be X11 screen size. While doing so, we fail to actually check whether the CRTC is active or not, meaning we'll try to query the content of the CRTC configuration even though it has none, leading to a NULL pointer dereference. Fix this by simply ignoring non-configured CRTCs. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1093 --- src/backends/x11/meta-monitor-manager-xrandr.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/backends/x11/meta-monitor-manager-xrandr.c') diff --git a/src/backends/x11/meta-monitor-manager-xrandr.c b/src/backends/x11/meta-monitor-manager-xrandr.c index 9531bb276..fd105c07a 100644 --- a/src/backends/x11/meta-monitor-manager-xrandr.c +++ b/src/backends/x11/meta-monitor-manager-xrandr.c @@ -400,9 +400,13 @@ apply_crtc_assignments (MetaMonitorManager *manager, { MetaCrtcInfo *crtc_info = crtcs[i]; MetaCrtc *crtc = crtc_info->crtc; - MetaCrtcConfig *crtc_config = crtc->config; + MetaCrtcConfig *crtc_config; int x2, y2; + crtc_config = crtc->config; + if (!crtc_config) + continue; + x2 = (int) roundf (crtc_config->layout.origin.x + crtc_config->layout.size.width); y2 = (int) roundf (crtc_config->layout.origin.y + -- cgit v1.2.1