From c0e9374d9ce4b49918564d305dc606ad6c3bf12b Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 27 Dec 2004 22:50:45 +0000 Subject: gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file) Avoid 2004-12-27 Matthias Clasen * gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file) Avoid deadlock. Pointed out by Callum McKenzie. --- gdk-pixbuf/ChangeLog | 5 +++++ gdk-pixbuf/gdk-pixbuf-animation.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'gdk-pixbuf') diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 0111c22007..2b453a37bc 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,8 @@ +2004-12-27 Matthias Clasen + + * gdk-pixbuf-animation.c (gdk_pixbuf_animation_new_from_file) + Avoid deadlock. Pointed out by Callum McKenzie. + Wed Dec 22 01:17:44 2004 Jonathan Blandford * queryloaders.c (main): print out the version and binary name in diff --git a/gdk-pixbuf/gdk-pixbuf-animation.c b/gdk-pixbuf/gdk-pixbuf-animation.c index 22bf245602..2e84d333ac 100644 --- a/gdk-pixbuf/gdk-pixbuf-animation.c +++ b/gdk-pixbuf/gdk-pixbuf-animation.c @@ -139,7 +139,7 @@ gdk_pixbuf_animation_new_from_file (const char *filename, guchar buffer [128]; GdkPixbufModule *image_module; gchar *display_name; - gboolean locked; + gboolean locked = FALSE; g_return_val_if_fail (filename != NULL, NULL); g_return_val_if_fail (error == NULL || *error == NULL, NULL); @@ -184,8 +184,6 @@ gdk_pixbuf_animation_new_from_file (const char *filename, return NULL; } - locked = _gdk_pixbuf_lock (image_module); - if (image_module->load_animation == NULL) { GdkPixbuf *pixbuf; @@ -221,6 +219,8 @@ gdk_pixbuf_animation_new_from_file (const char *filename, g_object_unref (pixbuf); } else { + locked = _gdk_pixbuf_lock (image_module); + fseek (f, 0, SEEK_SET); animation = (* image_module->load_animation) (f, error); -- cgit v1.2.1