From efb577efb0cd23e98caad1544f556cb82130f8e0 Mon Sep 17 00:00:00 2001 From: Florian Zwoch Date: Thu, 26 Nov 2020 09:59:44 +0100 Subject: [PATCH] screen-cast: Fix segfault when drawing cursor Add a sanity check if the cursor is on screen and cursor texture data is available. This prevents a potential segfault when trying to access non-existing texture data. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1446 Part-of: --- src/backends/meta-screen-cast-monitor-stream-src.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/backends/meta-screen-cast-monitor-stream-src.c b/src/backends/meta-screen-cast-monitor-stream-src.c index 2a22dc535..ab3be9683 100644 --- a/src/backends/meta-screen-cast-monitor-stream-src.c +++ b/src/backends/meta-screen-cast-monitor-stream-src.c @@ -443,6 +443,9 @@ maybe_paint_cursor_sprite (MetaScreenCastMonitorStreamSrc *monitor_src, cairo_surface_t *surface; cairo_t *cr; + if (!is_cursor_in_stream (monitor_src)) + return; + cursor_sprite = meta_cursor_renderer_get_cursor (cursor_renderer); if (!cursor_sprite) return;