[gnome-shell] shell-screenshot: Avoid a crash when the cursor texture is NULL



commit ff814df03a8126d9e8c719c135dfee5368a472b8
Author: Rui Matos <tiagomatos gmail com>
Date:   Mon Sep 19 15:34:03 2016 +0200

    shell-screenshot: Avoid a crash when the cursor texture is NULL
    
    Analogously to commit 2a7f9f70b836aee8605876186ff75d001d8ce63d for the
    screen recorder, as a wayland compositor, the cursor texture might not
    exist.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=771656

 src/shell-screenshot.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/shell-screenshot.c b/src/shell-screenshot.c
index 089828e..0e5e69d 100644
--- a/src/shell-screenshot.c
+++ b/src/shell-screenshot.c
@@ -263,6 +263,10 @@ _draw_cursor_image (MetaCursorTracker     *tracker,
   int x, y;
   int xhot, yhot;
 
+  texture = meta_cursor_tracker_get_sprite (tracker);
+  if (!texture)
+    return;
+
   screenshot_region = cairo_region_create_rectangle (&area);
   meta_cursor_tracker_get_pointer (tracker, &x, &y, NULL);
 
@@ -272,7 +276,6 @@ _draw_cursor_image (MetaCursorTracker     *tracker,
       return;
     }
 
-  texture = meta_cursor_tracker_get_sprite (tracker);
   meta_cursor_tracker_get_hot (tracker, &xhot, &yhot);
   width = cogl_texture_get_width (texture);
   height = cogl_texture_get_height (texture);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]