[gitg] Fix crash if the cursor surface is null
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg] Fix crash if the cursor surface is null
- Date: Sun, 20 Dec 2015 18:36:54 +0000 (UTC)
commit b801f79ee002dae64d3d964456dc04f471f998b6
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Sun Dec 20 19:36:24 2015 +0100
Fix crash if the cursor surface is null
libgitg/gitg-platform-support.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/libgitg/gitg-platform-support.c b/libgitg/gitg-platform-support.c
index aaad1d8..77c0227 100644
--- a/libgitg/gitg-platform-support.c
+++ b/libgitg/gitg-platform-support.c
@@ -56,6 +56,11 @@ gitg_platform_support_create_cursor_surface (GdkDisplay *display,
cursor = gdk_cursor_new_for_display (display, cursor_type);
surface = gdk_cursor_get_surface (cursor, hot_x, hot_y);
+ if (surface == NULL)
+ {
+ return NULL;
+ }
+
switch (cairo_surface_get_type (surface))
{
case CAIRO_SURFACE_TYPE_XLIB:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]