From 1790320ba3063ed1661cd7ca1e8590ac4ab901a6 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 17 Nov 2017 14:07:20 +0100 Subject: [PATCH] backends: Protect from reentrancy in meta_cursor_sprite_load_from_theme This function is supposedly not failable, so just move the theme_dirty flag clearing to the beginning of the function. Protects against cases where requesting a cursor image may result in it being loaded and set as a texture, which emits ::texture-changed, which may end up requesting the cursor image again. https://bugzilla.gnome.org/show_bug.cgi?id=754806 --- src/backends/meta-cursor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backends/meta-cursor.c b/src/backends/meta-cursor.c index ccd0ab017..beeee765b 100644 --- a/src/backends/meta-cursor.c +++ b/src/backends/meta-cursor.c @@ -229,6 +229,8 @@ meta_cursor_sprite_load_from_theme (MetaCursorSprite *self) g_assert (self->cursor != META_CURSOR_NONE); + self->theme_dirty = FALSE; + /* We might be reloading with a different scale. If so clear the old data. */ if (self->xcursor_images) { @@ -244,8 +246,6 @@ meta_cursor_sprite_load_from_theme (MetaCursorSprite *self) image = meta_cursor_sprite_get_current_frame_image (self); meta_cursor_sprite_load_from_xcursor_image (self, image); - - self->theme_dirty = FALSE; } MetaCursorSprite *