diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2001-09-14 22:04:55 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2001-09-14 22:04:55 +0000 |
commit | 49b3e05a30bb7de83f3c1016d11ee7e482f439a5 (patch) | |
tree | b3cafb1c7355ae8a6fbd4e6ca94ab2d6b2010f8a /gdk-pixbuf/io-tiff.c | |
parent | a5f9754350e803af7838a3c98a34418077e52fbb (diff) | |
download | gtk+-49b3e05a30bb7de83f3c1016d11ee7e482f439a5.tar.gz |
Robustness fixes and test images for the jpeg, tiff, pnm, gif, xpm and tga
loaders.
Diffstat (limited to 'gdk-pixbuf/io-tiff.c')
-rw-r--r-- | gdk-pixbuf/io-tiff.c | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/gdk-pixbuf/io-tiff.c b/gdk-pixbuf/io-tiff.c index 9bae4f832b..d8b799344b 100644 --- a/gdk-pixbuf/io-tiff.c +++ b/gdk-pixbuf/io-tiff.c @@ -257,11 +257,10 @@ gdk_pixbuf__tiff_image_load (FILE *f, GError **error) fd = fileno (f); tiff = TIFFFdOpen (fd, "libpixbuf-tiff", "r"); - if (!tiff) { - g_set_error (error, - GDK_PIXBUF_ERROR, - GDK_PIXBUF_ERROR_CORRUPT_IMAGE, - _("Failed to open TIFF image")); + if (!tiff || global_error) { + tiff_set_error (error, + GDK_PIXBUF_ERROR_CORRUPT_IMAGE, + _("Failed to open TIFF image")); tiff_pop_handlers (); G_UNLOCK (tiff_loader); @@ -404,11 +403,10 @@ gdk_pixbuf__tiff_image_stop_load (gpointer data, tiff_seek, tiff_close, tiff_size, tiff_map_file, tiff_unmap_file); - if (!tiff) { - g_set_error (error, - GDK_PIXBUF_ERROR, - GDK_PIXBUF_ERROR_FAILED, - _("Failed to load TIFF image")); + if (!tiff || global_error) { + tiff_set_error (error, + GDK_PIXBUF_ERROR_FAILED, + _("Failed to load TIFF image")); retval = FALSE; } else { GdkPixbuf *pixbuf; @@ -418,10 +416,16 @@ gdk_pixbuf__tiff_image_stop_load (gpointer data, g_object_unref (G_OBJECT (pixbuf)); retval = pixbuf != NULL; TIFFClose (tiff); + if (global_error) + { + tiff_set_error (error, + GDK_PIXBUF_ERROR_FAILED, + _("Failed to load TIFF image")); + retval = FALSE; + } } - - if (global_error) - g_warning ("Error left set in TIFF loader\n"); + + g_assert (!global_error); g_free (context->buffer); g_free (context); |