1
0
Fork 0

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>
This commit is contained in:
Florian Zwoch 2020-11-26 09:59:44 +01:00
parent 6c4b897d74
commit efb577efb0

View file

@ -443,6 +443,9 @@ maybe_paint_cursor_sprite (MetaScreenCastMonitorStreamSrc *monitor_src,
cairo_surface_t *surface; cairo_surface_t *surface;
cairo_t *cr; cairo_t *cr;
if (!is_cursor_in_stream (monitor_src))
return;
cursor_sprite = meta_cursor_renderer_get_cursor (cursor_renderer); cursor_sprite = meta_cursor_renderer_get_cursor (cursor_renderer);
if (!cursor_sprite) if (!cursor_sprite)
return; return;