forked from AuroraMiddleware/gtk
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.
This commit is contained in:
parent
367cacdf1b
commit
09487ff9f5
@ -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):
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user