summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorMatthias Clasen <matthiasc@src.gnome.org>2002-07-06 08:55:51 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2002-07-06 08:55:51 +0000
commit09487ff9f537152473cfed4ee3afe450606e60b4 (patch)
treee5308b2745f0125998727ee6cfa60d44c45b933f /gdk-pixbuf
parent367cacdf1b879c5bfa16f21502c80d8ed152ebef (diff)
downloadgtk+-09487ff9f537152473cfed4ee3afe450606e60b4.tar.gz
Handle global_error == NULL better. (tiff_image_parse): Don't trust
* io-tiff.c (tiff_set_error): Handle global_error == NULL better. (tiff_image_parse): Don't trust TIFFRGBAImageBegin to set the "put" routine. (Fixes #87384) (gdk_pixbuf__tiff_image_stop_load): Don't call TIFFClose too early.
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/ChangeLog9
-rw-r--r--gdk-pixbuf/io-tiff.c30
2 files changed, 32 insertions, 7 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog
index 6d0003d301..f72862b77d 100644
--- a/gdk-pixbuf/ChangeLog
+++ b/gdk-pixbuf/ChangeLog
@@ -1,3 +1,12 @@
+2002-07-06 Matthias Clasen <maclas@gmx.de>
+
+ * io-tiff.c (tiff_set_error): Handle global_error == NULL
+ better.
+ (tiff_image_parse): Don't trust TIFFRGBAImageBegin to set
+ the "put" routine. (Fixes #87384)
+ (gdk_pixbuf__tiff_image_stop_load): Don't call TIFFClose too
+ early.
+
2002-07-02 Matthias Clasen <maclas@gmx.de>
Miscellaneous bmp loader fixes (#85448, #86286, #86287):
diff --git a/gdk-pixbuf/io-tiff.c b/gdk-pixbuf/io-tiff.c
index a8365fa961..deae12bd77 100644
--- a/gdk-pixbuf/io-tiff.c
+++ b/gdk-pixbuf/io-tiff.c
@@ -119,16 +119,20 @@ tiff_set_error (GError **error,
/* Take the error message from libtiff and merge it with
* some context we provide.
*/
- g_set_error (error,
- GDK_PIXBUF_ERROR,
- error_code,
- "%s%s%s",
- msg, global_error ? ": " : "", global_error);
-
if (global_error) {
+ g_set_error (error,
+ GDK_PIXBUF_ERROR,
+ error_code,
+ "%s%s%s", msg, ": ", global_error);
+
g_free (global_error);
global_error = NULL;
}
+ else {
+ g_set_error (error,
+ GDK_PIXBUF_ERROR,
+ error_code, msg);
+ }
}
@@ -256,6 +260,14 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
return NULL;
}
+ if (img.put.any == NULL) {
+ tiff_set_error (error,
+ GDK_PIXBUF_ERROR_FAILED,
+ _("Unsupported TIFF variant"));
+ g_object_unref (pixbuf);
+ return NULL;
+ }
+
if (img.isContig) {
tiff_put_contig = img.put.contig;
img.put.contig = put_contig;
@@ -476,16 +488,20 @@ gdk_pixbuf__tiff_image_stop_load (gpointer data,
if (pixbuf)
g_object_unref (pixbuf);
retval = pixbuf != NULL;
- TIFFClose (tiff);
if (global_error)
{
tiff_set_error (error,
GDK_PIXBUF_ERROR_FAILED,
_("Failed to load TIFF image"));
+ tiff_pop_handlers ();
+
retval = FALSE;
}
}
+ if (tiff)
+ TIFFClose (tiff);
+
g_assert (!global_error);
g_free (context->buffer);