[gnome-desktop] gnome-bg: don't try to use a null format



commit f2a6d5ea97b98ea3b1d36bb1de83f3bfc92c5c73
Author: Ray Strode <rstrode redhat com>
Date:   Thu Sep 30 01:07:50 2010 -0400

    gnome-bg: don't try to use a null format
    
    commit 9a2c931869214d5113e3c9246cc36c094bd211fe
    introduced a bug that would cause a warning to
    spew in gnome-screensaver.

 libgnome-desktop/gnome-bg.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/libgnome-desktop/gnome-bg.c b/libgnome-desktop/gnome-bg.c
index 7629ef3..caba34d 100644
--- a/libgnome-desktop/gnome-bg.c
+++ b/libgnome-desktop/gnome-bg.c
@@ -1676,8 +1676,14 @@ get_as_pixbuf_for_size (GnomeBG    *bg,
 
 		/* If scalable choose maximum size */
 		format = gdk_pixbuf_get_file_info (filename, NULL, NULL);
-                tmp = gdk_pixbuf_format_get_name (format);
-		if (format != NULL &&
+
+                if (format != NULL) {
+                        tmp = gdk_pixbuf_format_get_name (format);
+                } else {
+                        tmp = NULL;
+                }
+
+		if (tmp != NULL &&
 		    strcmp (tmp, "svg") == 0 &&
 		    (best_width > 0 && best_height > 0) &&
 		    (bg->placement == GNOME_BG_PLACEMENT_FILL_SCREEN ||



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