* 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-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
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;
retval = gif_main_loop (context);
if (retval == -2) {
- context->buf = NULL;
+ if (context->buf == buf)
+ context->buf = NULL;
return FALSE;
}
if (retval == -1) {
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
_("Insufficient memory to open TIFF file"));
+ g_object_unref (pixbuf);
+
return NULL;
}
tiff_set_error (error,
GDK_PIXBUF_ERROR_FAILED,
_("Failed to load RGB data from TIFF file"));
+ g_object_unref (pixbuf);
_TIFFfree (rast);
return NULL;