[mutter/cherry-pick-efb577ef] screen-cast: Fix segfault when drawing cursor
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/cherry-pick-efb577ef] screen-cast: Fix segfault when drawing cursor
- Date: Thu, 26 Nov 2020 12:18:20 +0000 (UTC)
commit 2fadb8fec0b77c1e49acefe8a619b762d8a73b77
Author: Florian Zwoch <fzwoch gmail com>
Date: Thu Nov 26 08:59:44 2020 +0000
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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1604>
(cherry picked from commit efb577efb0cd23e98caad1544f556cb82130f8e0)
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 2a22dc5359..ab3be96836 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]