diff options
author | Matthias Clasen <maclas@gmx.de> | 2003-01-02 23:13:11 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2003-01-02 23:13:11 +0000 |
commit | 12a0888500b6981fb02aa3cd14814622f4d01b6d (patch) | |
tree | f518f0f80f6f3bf190c0bebc204aadd30ff9aa7a /gdk-pixbuf | |
parent | 59c27f2b0e24df03092bbd9a1f7acf89c93164db (diff) | |
download | gtk+-12a0888500b6981fb02aa3cd14814622f4d01b6d.tar.gz |
Don't crash if gdk-pixbuf.loaders file is missing. (#102222)
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)
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/ChangeLog | 5 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-io.c | 14 |
2 files changed, 13 insertions, 6 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 5120a9ef29..cd401dd5a2 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -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: diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c index 9642182a8c..cf3e8377b0 100644 --- a/gdk-pixbuf/gdk-pixbuf-io.c +++ b/gdk-pixbuf/gdk-pixbuf-io.c @@ -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 |