[gimp] file-gif-load: Fix incorrect out-of-input-bits condition (#695513)



commit f86655bb1fcf356524c1894096f4866633cc7666
Author: Mukund Sivaraman <muks banu com>
Date:   Tue Mar 12 13:08:14 2013 +0530

    file-gif-load: Fix incorrect out-of-input-bits condition (#695513)
    
    GetCode() erroneously assumes that it has run out of input bits, because
    it's off by 1 in its size calculation. At the end of the block, if the
    End-of-Information code is exactly at the block boundary, it calculates
    that it needs to read an extra bit, and tries to read beyond the end of
    the block. It fails then, and the End-of-Information code is not
    processed, and other warnings/errors are generated.

 plug-ins/common/file-gif-load.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/plug-ins/common/file-gif-load.c b/plug-ins/common/file-gif-load.c
index e01dfe6..7fbf292 100644
--- a/plug-ins/common/file-gif-load.c
+++ b/plug-ins/common/file-gif-load.c
@@ -685,7 +685,7 @@ GetCode (FILE     *fd,
       return 0;
     }
 
-  while ((curbit + code_size) >= lastbit)
+  while ((curbit + code_size) > lastbit)
     {
       if (done)
         {


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