[gnome-shell] shell-recorder: Avoid a crash when the cursor texture is NULL
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] shell-recorder: Avoid a crash when the cursor texture is NULL
- Date: Tue, 28 Jun 2016 17:04:36 +0000 (UTC)
commit 2a7f9f70b836aee8605876186ff75d001d8ce63d
Author: Rui Matos <tiagomatos gmail com>
Date: Mon Jun 6 20:28:34 2016 +0200
shell-recorder: Avoid a crash when the cursor texture is NULL
When running as a wayland compositor, MetaCursorTracker might
legitimately not have a displayed cursor because e.g. a client unsets
the cursor surface.
Note that, under an X session, the assumption that the tracker always
has a cursor texture is true because XFixesGetCursorImage() always
returns data even if the cursor isn't visible.
https://bugzilla.gnome.org/show_bug.cgi?id=767001
src/shell-recorder.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/shell-recorder.c b/src/shell-recorder.c
index ef729ff..e7562ef 100644
--- a/src/shell-recorder.c
+++ b/src/shell-recorder.c
@@ -321,6 +321,9 @@ recorder_fetch_cursor_image (ShellRecorder *recorder)
guint8 *data;
texture = meta_cursor_tracker_get_sprite (recorder->cursor_tracker);
+ if (!texture)
+ return;
+
width = cogl_texture_get_width (texture);
height = cogl_texture_get_height (texture);
stride = 4 * width;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]