]> Pileus Git - ~andy/gtk/commitdiff
Don't crash if gdk-pixbuf.loaders file is missing. (#102222)
authorMatthias Clasen <maclas@gmx.de>
Thu, 2 Jan 2003 23:13:11 +0000 (23:13 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Thu, 2 Jan 2003 23:13:11 +0000 (23:13 +0000)
2003-01-03  Matthias Clasen  <maclas@gmx.de>

* gdk-pixbuf-io.c (gdk_pixbuf_new_from_xpm_data): Don't crash if
gdk-pixbuf.loaders file is missing.  (#102222)

gdk-pixbuf/ChangeLog
gdk-pixbuf/gdk-pixbuf-io.c

index 5120a9ef290ab8c3c593f2d5b121123de4c7862b..cd401dd5a289735f651d05381b390d9a22ca0a86 100644 (file)
@@ -1,3 +1,8 @@
+2003-01-03  Matthias Clasen  <maclas@gmx.de>
+
+       * gdk-pixbuf-io.c (gdk_pixbuf_new_from_xpm_data): Don't crash if
+       gdk-pixbuf.loaders file is missing.  (#102222)
+
 2002-12-08  Matthias Clasen  <maclas@gmx.de>
 
        * gdk-pixbuf-animation.h: 
index 9642182a8c714656c26ac9b2cacb2512258cb5b6..cf3e8377b0e3bc9375787ab2175064aabba7936e 100644 (file)
@@ -779,20 +779,22 @@ gdk_pixbuf_new_from_xpm_data (const char **data)
        GdkPixbuf *(* load_xpm_data) (const char **data);
        GdkPixbuf *pixbuf;
         GError *error = NULL;
-       GdkPixbufModule *xpm_module = _gdk_pixbuf_get_named_module ("xpm", NULL);
+       GdkPixbufModule *xpm_module = _gdk_pixbuf_get_named_module ("xpm", &error);
+       if (xpm_module == NULL) {
+               g_warning ("Error loading XPM image loader: %s", error->message);
+               g_error_free (error);
+               return NULL;
+       }
 
        if (xpm_module->module == NULL) {
                 if (!_gdk_pixbuf_load_module (xpm_module, &error)) {
                         g_warning ("Error loading XPM image loader: %s", error->message);
                         g_error_free (error);
-                        return FALSE;
+                        return NULL;
                 }
         }
           
-       if (xpm_module->module == NULL) {
-               g_warning ("Can't find gdk-pixbuf module for parsing inline XPM data");
-               return NULL;
-       } else if (xpm_module->load_xpm_data == NULL) {
+       if (xpm_module->load_xpm_data == NULL) {
                g_warning ("gdk-pixbuf XPM module lacks XPM data capability");
                return NULL;
        } else