#33220 [Asn]: GIF image with errors makes imagecreatefromgif() go into infinite loop
| From: | pajoye@php.net | Date: | Sat, 24 Sep 2005 14:42:06 +0000 |
| Subject: | #33220 [Asn]: GIF image with errors makes imagecreatefromgif() go into infinite loop | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-85536@lists.php.net to get a copy of this message | ||
ID: 33220
Updated by: pajoye@php.net
Reported By: phpbugs at pureftpd dot org
Status: Assigned
Bug Type: GD related
Operating System: *
PHP Version: 5CVS-2005-08-17
Assigned To: pajoye
New Comment:
Patch applied in all active branches. I keep this bug as 'assigned' as
there is other cases which cause an infinite loop.
Previous Comments:
------------------------------------------------------------------------
[2005-09-24 12:23:44] nlopess@php.net
I've made a patch to fix this problem:
http://mega.ist.utl.pt/~ncpl/php_gd_patch.txt
The problem: GetDataBlock_() returns -1 on error, but most calls to
that function were checking only == 0, thus creating the infinite loop.
changing those to <=0 fixes the problems.
------------------------------------------------------------------------
[2005-08-22 17:45:42] sniper@php.net
Pierre, are you going to do something for this bug?
------------------------------------------------------------------------
[2005-06-02 15:11:16] phpbugs at pureftpd dot org
Description:
------------
The following (invalid) picture triggers an infinite loop
in gdImageCreateFromGif() with 100% CPU usage.
Tested on Linux and OpenBSD, PHP4 with GD 1 and PHP5 with
built-in GD.
Reproduce code:
---------------
<?php
imagecreatefromgif('kaboom-gd.gif');
?>
Get kaboom-gd.gif from ftp://ftp.00f.net/misc/kaboom-gd.gif
Expected result:
----------------
No 100% CPU usage.
Actual result:
--------------
100% CPU usage, infinite loop.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33220&edit=1