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)
This commit is contained in:
Matthias Clasen 2003-01-02 23:13:11 +00:00 committed by Matthias Clasen
parent 59c27f2b0e
commit 12a0888500
2 changed files with 13 additions and 6 deletions

View 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:

View 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