summaryrefslogtreecommitdiff
path: root/gdk/x11/gdkglcontext-x11.c
diff options
context:
space:
mode:
authorIgnacio Casal Quinteiro <icq@gnome.org>2015-07-17 09:31:32 +0200
committerIgnacio Casal Quinteiro <icq@gnome.org>2015-07-17 14:26:11 +0200
commit186c8f5254a7b9b29df6d9708a5d10f869d6829d (patch)
tree802ff9af12f7acdb9bb97833f9604ea4c81acb08 /gdk/x11/gdkglcontext-x11.c
parent02577ddb06d9fe9f9ddc2813d15f8c2100e31c36 (diff)
downloadgtk+-186c8f5254a7b9b29df6d9708a5d10f869d6829d.tar.gz
gdk: fix crash if visual is NULL
cairo_xlib_surface_get_visual might return NULL so we need to check for NULL before trying to use it. https://bugzilla.gnome.org/show_bug.cgi?id=752520
Diffstat (limited to 'gdk/x11/gdkglcontext-x11.c')
-rw-r--r--gdk/x11/gdkglcontext-x11.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gdk/x11/gdkglcontext-x11.c b/gdk/x11/gdkglcontext-x11.c
index c86cbd5a69..139fae6b97 100644
--- a/gdk/x11/gdkglcontext-x11.c
+++ b/gdk/x11/gdkglcontext-x11.c
@@ -326,6 +326,9 @@ glx_pixmap_get (cairo_surface_t *surface, guint texture_target)
None
};
+ if (visual == NULL)
+ return NULL;
+
with_alpha = cairo_surface_get_content (surface) == CAIRO_CONTENT_COLOR_ALPHA;
y_inverted = FALSE;