[vte] Fix crash when loading the bg pixbuf failed



commit 9a36a04d3f6edbb81a304b0cad3b60d2e90d2324
Author: Christian Persch <chpe gnome org>
Date:   Sat Apr 3 23:49:15 2010 +0200

    Fix crash when loading the bg pixbuf failed

 src/vtebg.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/vtebg.c b/src/vtebg.c
index 9357020..cc65bf1 100644
--- a/src/vtebg.c
+++ b/src/vtebg.c
@@ -359,8 +359,9 @@ vte_bg_cache_add(VteBg *bg, VteBgCacheItem *item)
 					  (gpointer*)(void*)&item->source_pixbuf);
 	}
 
-	cairo_surface_set_user_data (item->surface, &item_surface_key, item,
-				     item_surface_destroy_func);
+        if (item->surface != NULL)
+                cairo_surface_set_user_data (item->surface, &item_surface_key, item,
+                                            item_surface_destroy_func);
 }
 
 /* Search for a match in the cache, and if found, return an object with an



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