[vte] Don't crash when root_surface is NULL



commit bc3a50d2d6024e8b01bb64f9e0e908de123216a2
Author: Christian Persch <chpe gnome org>
Date:   Sun Apr 11 21:00:01 2010 +0200

    Don't crash when root_surface is NULL

 src/vtebg.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/vtebg.c b/src/vtebg.c
index e68883f..fc6981a 100644
--- a/src/vtebg.c
+++ b/src/vtebg.c
@@ -481,7 +481,8 @@ vte_bg_get_surface(VteBg *bg,
 		height = gdk_pixbuf_get_height(pixbuf);
 	}
 #ifdef GDK_WINDOWING_X11
-        else if (source_type == VTE_BG_SOURCE_ROOT) {
+        else if (source_type == VTE_BG_SOURCE_ROOT &&
+                 pvt->root_surface != NULL) {
 		width = cairo_xlib_surface_get_width(pvt->root_surface);
 		height = cairo_xlib_surface_get_height(pvt->root_surface);
 	}



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