summaryrefslogtreecommitdiff
path: root/src/backends/x11/meta-monitor-manager-xrandr.c
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2020-02-26 16:10:12 +0100
committerJonas Ådahl <jadahl@gmail.com>2020-02-26 16:14:04 +0100
commit9fa56176fd5c95b609cc52b594baa47880961aa9 (patch)
treeb109048524942bdb634d726b7157b5325aa31b91 /src/backends/x11/meta-monitor-manager-xrandr.c
parentfb81199decf5f463b617b0d4e1f3d3fbe26efad0 (diff)
downloadmutter-9fa56176fd5c95b609cc52b594baa47880961aa9.tar.gz
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
Diffstat (limited to 'src/backends/x11/meta-monitor-manager-xrandr.c')
-rw-r--r--src/backends/x11/meta-monitor-manager-xrandr.c6
1 files changed, 5 insertions, 1 deletions
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 +