forked from AuroraMiddleware/gtk
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:
parent
e619443288
commit
c22b614565
@ -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
|
||||
|
@ -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,8 +564,8 @@ prepared_notify (GdkPixbuf *pixbuf,
|
||||
*((GdkPixbuf **)user_data) = pixbuf;
|
||||
}
|
||||
|
||||
static GdkPixbuf *
|
||||
generic_image_load (GdkPixbufModule *module,
|
||||
GdkPixbuf *
|
||||
_gdk_pixbuf_generic_image_load (GdkPixbufModule *module,
|
||||
FILE *f,
|
||||
GError **error)
|
||||
{
|
||||
@ -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++)
|
||||
|
Loading…
Reference in New Issue
Block a user