[gthumb] check whether surface is null before using it



commit 98e5e7aaa7ecedf9c56382b767c74f3d3ad11dd6
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Fri Apr 29 22:57:30 2011 +0200

    check whether surface is null before using it

 gthumb/pixbuf-utils.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/gthumb/pixbuf-utils.c b/gthumb/pixbuf-utils.c
index f3f774b..a26f0fb 100644
--- a/gthumb/pixbuf-utils.c
+++ b/gthumb/pixbuf-utils.c
@@ -80,6 +80,9 @@ _gdk_pixbuf_new_from_cairo_surface (cairo_surface_t *surface)
 	guchar        *p_pixels;
 	int            p_n_channels;
 
+	if (surface == NULL)
+		return NULL;
+
 	if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS)
 		return NULL;
 



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