[mutter] Fix crash when cursor theme lookup failed
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] Fix crash when cursor theme lookup failed
- Date: Tue, 29 Apr 2014 20:20:40 +0000 (UTC)
commit d9a2443e530b82d742c401206e371302a77e5338
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Apr 29 22:14:34 2014 +0200
Fix crash when cursor theme lookup failed
meta_cursor_reference_from_theme() may return %NULL on failure,
in which case we currently crash when trying to release it.
src/core/display.c | 3 ++-
src/core/screen.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/core/display.c b/src/core/display.c
index 041393b..147cb82 100644
--- a/src/core/display.c
+++ b/src/core/display.c
@@ -1709,7 +1709,8 @@ meta_display_set_grab_op_cursor (MetaDisplay *display,
cursor_ref = meta_cursor_reference_from_theme (cursor);
meta_cursor_tracker_set_grab_cursor (tracker, cursor_ref);
- meta_cursor_reference_unref (cursor_ref);
+ if (cursor_ref)
+ meta_cursor_reference_unref (cursor_ref);
if (meta_backend_grab_device (backend, META_VIRTUAL_CORE_POINTER_ID, timestamp))
display->grab_have_pointer = TRUE;
diff --git a/src/core/screen.c b/src/core/screen.c
index e1dc6cd..6ceab47 100644
--- a/src/core/screen.c
+++ b/src/core/screen.c
@@ -1376,7 +1376,8 @@ meta_screen_update_cursor (MetaScreen *screen)
cursor_ref = meta_cursor_reference_from_theme (cursor);
meta_cursor_tracker_set_root_cursor (tracker, cursor_ref);
- meta_cursor_reference_unref (cursor_ref);
+ if (cursor_ref)
+ meta_cursor_reference_unref (cursor_ref);
/* Set a cursor for X11 applications that don't specify their own */
xcursor = meta_display_create_x_cursor (display, cursor);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]