summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2014-01-02 20:53:54 -0500
committerRyan Lortie <desrt@desrt.ca>2014-01-02 20:54:36 -0500
commit7eccf98299d0142c3f0f9ece7e3fa3dc0929e45b (patch)
tree0650089a4566dc6ea454c2227e0e974624c8e880 /gdk-pixbuf
parent369a828af6ed09e7f4160cb353b9f9de2dfe495c (diff)
downloadgdk-pixbuf-7eccf98299d0142c3f0f9ece7e3fa3dc0929e45b.tar.gz
qtif: fix fread() error check
fread() doesn't return -1 on error, so don't check for < 0. https://bugzilla.gnome.org/show_bug.cgi?id=721371
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/io-qtif.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/gdk-pixbuf/io-qtif.c b/gdk-pixbuf/io-qtif.c
index e0ebe6341..404c7e52f 100644
--- a/gdk-pixbuf/io-qtif.c
+++ b/gdk-pixbuf/io-qtif.c
@@ -196,10 +196,7 @@ static GdkPixbuf *gdk_pixbuf__qtif_image_load (FILE *f, GError **error)
/* Read atom data. */
while(hdr.length != 0u)
{
- rd = (hdr.length > READ_BUFFER_SIZE) ? READ_BUFFER_SIZE : hdr.length;
-
- rd = fread(buf, 1, rd, f);
- if(rd < 0)
+ if(fread(buf, 1, rd, f) != rd)
{
g_set_error(error, GDK_PIXBUF_ERROR,
GDK_PIXBUF_ERROR_CORRUPT_IMAGE,