Commit 00e2cde0 authored by Matthias Clasen's avatar Matthias Clasen

gdk-pixbuf-io.c (_gdk_pixbuf_generic_image_load): No longer static, thus

	* gdk-pixbuf-io.h:
	gdk-pixbuf-io.c (_gdk_pixbuf_generic_image_load): No longer
	static, thus _gdk_pixbuf-prefixed.

	* gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file):
	Keep this logic in sync with gdk_pixbuf_new_from_file().  (Based
	on a patch by Anders Carlsson)

	* io-png.c (gdk_pixbuf__png_image_save): Plug a memory
	leak.  (#91422, Sven Neumann)
parent 9c95dfdb
......@@ -176,18 +176,8 @@ gdk_pixbuf_animation_new_from_file (const char *filename,
/* Keep this logic in sync with gdk_pixbuf_new_from_file() */
if (image_module->load == NULL) {
g_set_error (error,
GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_UNSUPPORTED_OPERATION,
_("Don't know how to load the animation in file '%s'"),
filename);
fclose (f);
return NULL;
}
fseek (f, 0, SEEK_SET);
pixbuf = (* image_module->load) (f, error);
pixbuf = _gdk_pixbuf_generic_image_load (image_module, f, error);
fclose (f);
if (pixbuf == NULL && error != NULL && *error == NULL) {
......
......@@ -564,10 +564,10 @@ prepared_notify (GdkPixbuf *pixbuf,
*((GdkPixbuf **)user_data) = pixbuf;
}
static GdkPixbuf *
generic_image_load (GdkPixbufModule *module,
FILE *f,
GError **error)
GdkPixbuf *
_gdk_pixbuf_generic_image_load (GdkPixbufModule *module,
FILE *f,
GError **error)
{
guchar buffer[4096];
size_t length;
......@@ -663,14 +663,14 @@ gdk_pixbuf_new_from_file (const char *filename,
}
fseek (f, 0, SEEK_SET);
pixbuf = generic_image_load (image_module, f, error);
pixbuf = _gdk_pixbuf_generic_image_load (image_module, f, error);
fclose (f);
if (pixbuf == NULL && error != NULL && *error == NULL) {
/* I don't trust these crufty longjmp()'ing image libs
* to maintain proper error invariants, and I don't
* want user code to segfault as a result. We need to maintain
* the invariant that error gets set if NULL is returned.
* the invariastable/gdk-pixbuf/nt that error gets set if NULL is returned.
*/
g_warning ("Bug! gdk-pixbuf loader '%s' didn't set an error on failure.", image_module->module_name);
......
......@@ -95,6 +95,10 @@ GdkPixbufModule *_gdk_pixbuf_get_named_module (const char *name,
gboolean _gdk_pixbuf_load_module (GdkPixbufModule *image_module,
GError **error);
GdkPixbuf *_gdk_pixbuf_generic_image_load (GdkPixbufModule *image_module,
FILE *f,
GError **error);
G_END_DECLS
......
......@@ -877,7 +877,7 @@ gdk_pixbuf__png_image_save (FILE *f,
png_write_end (png_ptr, info_ptr);
cleanup:
png_destroy_write_struct (&png_ptr, (png_infopp) NULL);
png_destroy_write_struct (&png_ptr, &info_ptr);
if (num_keys > 0) {
for (i = 0; i < num_keys; i++)
......
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