[gdk-pixbuf] io-gif: Switch arguments to fread() to fix Coverity issue



commit 82664fe35c73f28ecc8857b146e76768315f182a
Author: Philip Withnall <withnall endlessm com>
Date:   Tue Aug 1 15:34:17 2017 +0100

    io-gif: Switch arguments to fread() to fix Coverity issue
    
    The arguments were provided the wrong way round: the variable number
    should always be the nmemb argument, rather than loading a single
    element of variable size.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=785696

 gdk-pixbuf/io-gif.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gdk-pixbuf/io-gif.c b/gdk-pixbuf/io-gif.c
index 8991397..4efd00a 100644
--- a/gdk-pixbuf/io-gif.c
+++ b/gdk-pixbuf/io-gif.c
@@ -211,7 +211,7 @@ gif_read (GifContext *context, guchar *buffer, size_t len)
                count += len;
                g_print ("Fsize :%d\tcount :%d\t", len, count);
 #endif
-               retval = (fread(buffer, len, 1, context->file) != 0);
+               retval = (fread (buffer, 1, len, context->file) == len);
 
                 if (!retval && ferror (context->file)) {
                         gint save_errno = errno;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]