From b8914da0c88644e4a2b2e3e5fe248dd901bf7fa8 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 5 Feb 2024 10:00:43 +0100 Subject: [PATCH] input-capture: Fix barrier validation without a monitor at (0.0) For barrier validation, check_barrier() would start from the (presumably) left-most monitor and walk the neighbor monitors to the right. This is assuming that there is always a monitor at (0.0), which is not necessarily the case. If the first monitor on the left is not aligned at the top, there is no logical monitor at (0.0) causing a NULL pointer derefence. Instead of starting from the monitor at (0,0), start from the primary logical monitor, as there is necessarily one. Fixes: 85885c6 - Check barriers don't extend into nonexisting monitors Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3272 Part-of: --- src/backends/meta-input-capture-session.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backends/meta-input-capture-session.c b/src/backends/meta-input-capture-session.c index 73cb6e61f..26347cfea 100644 --- a/src/backends/meta-input-capture-session.c +++ b/src/backends/meta-input-capture-session.c @@ -754,7 +754,7 @@ check_barrier (MetaInputCaptureSession *session, MetaLogicalMonitor *next; MtkRectangle layout, fake_layout; - monitor = meta_monitor_manager_get_logical_monitor_at (monitor_manager, 0, 0); + monitor = meta_monitor_manager_get_primary_logical_monitor (monitor_manager); while ((next = meta_monitor_manager_get_logical_monitor_neighbor (monitor_manager, monitor, META_DISPLAY_RIGHT))) monitor = next;