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
This commit is contained in:
Ignacio Casal Quinteiro 2015-07-17 09:31:32 +02:00
parent 02577ddb06
commit 186c8f5254

View File

@ -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;