Commit de19229a authored by Matthias Clasen's avatar Matthias Clasen

Don't leak pixbuf on error.

	* io-tiff.c (tiff_image_parse): Don't leak pixbuf on error.

	* io-gif.c (gdk_pixbuf__gif_image_load_increment): Don't leak
	context->buf on error.

	* gdk-pixbuf-loader.c (gdk_pixbuf_loader_close): Make sure to call
	stop_load even for short images to prevent memleaks.
parent 94168cf8
2002-03-26 Matthias Clasen <maclas@gmx.de>
* io-tiff.c (tiff_image_parse): Don't leak pixbuf on error.
* io-gif.c (gdk_pixbuf__gif_image_load_increment): Don't leak
context->buf on error.
* gdk-pixbuf-loader.c (gdk_pixbuf_loader_close): Make sure to call
stop_load even for short images to prevent memleaks.
2002-03-25 Matthias Clasen <maclas@gmx.de>
* io-png.c (setup_png_transformations): Changed signature to
......
......@@ -536,8 +536,10 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader,
retval = FALSE;
}
}
if (retval && priv->image_module && priv->image_module->stop_load && priv->context)
retval = priv->image_module->stop_load (priv->context, error);
if (priv->image_module && priv->image_module->stop_load && priv->context) {
if (!priv->image_module->stop_load (priv->context, error))
retval = FALSE;
}
priv->closed = TRUE;
......
......@@ -1485,7 +1485,8 @@ gdk_pixbuf__gif_image_load_increment (gpointer data,
retval = gif_main_loop (context);
if (retval == -2) {
context->buf = NULL;
if (context->buf == buf)
context->buf = NULL;
return FALSE;
}
if (retval == -1) {
......
......@@ -192,6 +192,8 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
_("Insufficient memory to open TIFF file"));
g_object_unref (pixbuf);
return NULL;
}
......@@ -199,6 +201,7 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
tiff_set_error (error,
GDK_PIXBUF_ERROR_FAILED,
_("Failed to load RGB data from TIFF file"));
g_object_unref (pixbuf);
_TIFFfree (rast);
return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment