summaryrefslogtreecommitdiff
path: root/gdk-pixbuf/io-ani.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2004-04-13 14:57:03 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-04-13 14:57:03 +0000
commit99db67b8150871afb54c8f1eeb22f643f75345df (patch)
tree8b63dd01cf2b7e44b020596b710ecf1ece75660c /gdk-pixbuf/io-ani.c
parent8daec090109db417068f288935edfa157f1dbf2a (diff)
downloadgdk-pixbuf-99db67b8150871afb54c8f1eeb22f643f75345df.tar.gz
When calling fread() in a loop, check for ferror() as well as for feof()
2004-04-13 Matthias Clasen <mclasen@redhat.com> * io-ani.c (gdk_pixbuf__ani_image_load_animation): * gdk-pixbuf-io.c (gdk_pixbuf_get_file_info) (_gdk_pixbuf_generic_image_load) (gdk_pixbuf_new_from_file_at_size): When calling fread() in a loop, check for ferror() as well as for feof() to avoid infinite loops on directories. (#137804, Alex Converse)
Diffstat (limited to 'gdk-pixbuf/io-ani.c')
-rw-r--r--gdk-pixbuf/io-ani.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdk-pixbuf/io-ani.c b/gdk-pixbuf/io-ani.c
index f7565b533..00a9fc11b 100644
--- a/gdk-pixbuf/io-ani.c
+++ b/gdk-pixbuf/io-ani.c
@@ -626,7 +626,7 @@ gdk_pixbuf__ani_image_load_animation (FILE *f, GError **error)
if (!context)
return NULL;
- while (!feof (f)) {
+ while (!feof (f) && !ferror (f)) {
length = fread (buffer, 1, sizeof (buffer), f);
if (length > 0)
if (!gdk_pixbuf__ani_image_load_increment (context, buffer, length, error)) {