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.
This commit is contained in:
@ -1,3 +1,13 @@
|
|||||||
|
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>
|
2002-03-25 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
* io-png.c (setup_png_transformations): Changed signature to
|
* io-png.c (setup_png_transformations): Changed signature to
|
||||||
|
@ -536,8 +536,10 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader,
|
|||||||
retval = FALSE;
|
retval = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (retval && priv->image_module && priv->image_module->stop_load && priv->context)
|
if (priv->image_module && priv->image_module->stop_load && priv->context) {
|
||||||
retval = priv->image_module->stop_load (priv->context, error);
|
if (!priv->image_module->stop_load (priv->context, error))
|
||||||
|
retval = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
priv->closed = TRUE;
|
priv->closed = TRUE;
|
||||||
|
|
||||||
|
@ -1485,6 +1485,7 @@ gdk_pixbuf__gif_image_load_increment (gpointer data,
|
|||||||
retval = gif_main_loop (context);
|
retval = gif_main_loop (context);
|
||||||
|
|
||||||
if (retval == -2) {
|
if (retval == -2) {
|
||||||
|
if (context->buf == buf)
|
||||||
context->buf = NULL;
|
context->buf = NULL;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -192,6 +192,8 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
|
|||||||
GDK_PIXBUF_ERROR,
|
GDK_PIXBUF_ERROR,
|
||||||
GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
|
GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
|
||||||
_("Insufficient memory to open TIFF file"));
|
_("Insufficient memory to open TIFF file"));
|
||||||
|
g_object_unref (pixbuf);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -199,6 +201,7 @@ tiff_image_parse (TIFF *tiff, TiffContext *context, GError **error)
|
|||||||
tiff_set_error (error,
|
tiff_set_error (error,
|
||||||
GDK_PIXBUF_ERROR_FAILED,
|
GDK_PIXBUF_ERROR_FAILED,
|
||||||
_("Failed to load RGB data from TIFF file"));
|
_("Failed to load RGB data from TIFF file"));
|
||||||
|
g_object_unref (pixbuf);
|
||||||
_TIFFfree (rast);
|
_TIFFfree (rast);
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Reference in New Issue
Block a user