be extra careful when generating pixbufs (should mean we just get no

2007-06-15  Jens Granseuer  <jensgr@gmx.net>

	* appearance-desktop.c: (wp_props_load_wallpaper),
	(wp_scale_type_changed), (wp_shade_type_changed):
	* gnome-wp-utils.c: (gnome_wp_pixbuf_tile): be extra careful when
	generating pixbufs (should mean we just get no thumbs instead of
	assertion failures, bug #403160)

svn path=/trunk/; revision=7728
This commit is contained in:
Jens Granseuer 2007-06-15 17:57:49 +00:00 committed by Jens Granseuer
parent a2ec246221
commit 1c5d2a43bd
3 changed files with 25 additions and 20 deletions

View file

@ -36,7 +36,7 @@ GdkPixbuf * gnome_wp_pixbuf_new_gradient (GtkOrientation orientation,
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, width, height);
d = gdk_pixbuf_get_pixels (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf);
dr = c2->red - c1->red;
dg = c2->green - c1->green;
db = c2->blue - c1->blue;
@ -112,7 +112,7 @@ GdkPixbuf * gnome_wp_pixbuf_tile (GdkPixbuf * src_pixbuf,
gdouble cx, cy;
gint dwidth, dheight;
gint swidth, sheight;
guint alpha = 255;
const guint alpha = 255;
if (dest_pixbuf == NULL) {
return gdk_pixbuf_copy (src_pixbuf);
@ -120,6 +120,8 @@ GdkPixbuf * gnome_wp_pixbuf_tile (GdkPixbuf * src_pixbuf,
tmpbuf = gdk_pixbuf_scale_simple (src_pixbuf, scaled_width, scaled_height,
GDK_INTERP_BILINEAR);
if (!tmpbuf)
return NULL;
swidth = gdk_pixbuf_get_width (tmpbuf);
sheight = gdk_pixbuf_get_height (tmpbuf);