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)
This commit is contained in:
Matthias Clasen 2002-08-22 21:32:06 +00:00
parent e619443288
commit c22b614565
5 changed files with 25 additions and 18 deletions

View File

@ -1,3 +1,16 @@
2002-08-22 Matthias Clasen <maclas@gmx.de>
* 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 <sven@gimp.org>
* gdk-pixdata.c (gdk_pixdata_to_csource): free the result of

View File

@ -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) {

View File

@ -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);

View File

@ -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

View File

@ -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++)