pajoye          Sat Sep 24 10:37:51 2005 EDT

  Modified files:              
    /php-src/ext/gd/libgd       gd_gif_in.c 
  Log:
  - #33220, fix infinite loop while loading invalid gif, this patch fixes 
    at least many cases (nlopess)
  
  
http://cvs.php.net/diff.php/php-src/ext/gd/libgd/gd_gif_in.c?r1=1.6&r2=1.7&ty=u
Index: php-src/ext/gd/libgd/gd_gif_in.c
diff -u php-src/ext/gd/libgd/gd_gif_in.c:1.6 
php-src/ext/gd/libgd/gd_gif_in.c:1.7
--- php-src/ext/gd/libgd/gd_gif_in.c:1.6        Thu Aug 18 08:54:29 2005
+++ php-src/ext/gd/libgd/gd_gif_in.c    Sat Sep 24 10:37:49 2005
@@ -259,13 +259,13 @@
                if ((buf[0] & 0x1) != 0)
                        *Transparent = buf[3];
 
-               while (GetDataBlock(fd, (unsigned char*) buf) != 0)
+               while (GetDataBlock(fd, (unsigned char*) buf) > 0)
                        ;
                return FALSE;
        default:
                break;
        }
-       while (GetDataBlock(fd, (unsigned char*) buf) != 0)
+       while (GetDataBlock(fd, (unsigned char*) buf) > 0)
                ;
 
        return FALSE;
@@ -337,7 +337,7 @@
                buf[0] = buf[last_byte-2];
                buf[1] = buf[last_byte-1];
 
-               if ((count = GetDataBlock(fd, &buf[2])) == 0)
+               if ((count = GetDataBlock(fd, &buf[2])) <= 0)
                        done = TRUE;
 
                last_byte = 2 + count;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to