[gdk-pixbuf] qtif: fix fread() error check
- From: Ryan Lortie <desrt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gdk-pixbuf] qtif: fix fread() error check
- Date: Fri, 3 Jan 2014 14:34:46 +0000 (UTC)
commit 7eccf98299d0142c3f0f9ece7e3fa3dc0929e45b
Author: Ryan Lortie <desrt desrt ca>
Date: Thu Jan 2 20:53:54 2014 -0500
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
gdk-pixbuf/io-qtif.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/gdk-pixbuf/io-qtif.c b/gdk-pixbuf/io-qtif.c
index e0ebe63..404c7e5 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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]