diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index f7ebdd8f69..a93916acf2 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,16 @@ +2002-08-22 Matthias Clasen + + * 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) + 2002-07-31 Sven Neumann * gdk-pixdata.c (gdk_pixdata_to_csource): free the result of diff --git a/gdk-pixbuf/gdk-pixbuf-animation.c b/gdk-pixbuf/gdk-pixbuf-animation.c index 0d7df85793..4185eba91d 100644 --- a/gdk-pixbuf/gdk-pixbuf-animation.c +++ b/gdk-pixbuf/gdk-pixbuf-animation.c @@ -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) { diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c index 5f4cce9f31..c1861ad1c0 100644 --- a/gdk-pixbuf/gdk-pixbuf-io.c +++ b/gdk-pixbuf/gdk-pixbuf-io.c @@ -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); diff --git a/gdk-pixbuf/gdk-pixbuf-io.h b/gdk-pixbuf/gdk-pixbuf-io.h index 8cf233fe26..b0db1a2487 100644 --- a/gdk-pixbuf/gdk-pixbuf-io.h +++ b/gdk-pixbuf/gdk-pixbuf-io.h @@ -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 diff --git a/gdk-pixbuf/io-png.c b/gdk-pixbuf/io-png.c index dc886f8322..3b2317efda 100644 --- a/gdk-pixbuf/io-png.c +++ b/gdk-pixbuf/io-png.c @@ -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++)