cvs: php-src /ext/gd/libgd gd_gif_in.c
| From: | Pierre-Alain Joye | Date: | Sat, 24 Sep 2005 14:37:51 +0000 |
| Subject: | cvs: php-src /ext/gd/libgd gd_gif_in.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-34104@lists.php.net to get a copy of this message | ||
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;