|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33220 GIF image with errors makes imagecreatefromgif() go into infinite loop
Submitted: 2005-06-02 15:11 UTC Modified: 2005-12-07 00:54 UTC
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: phpbugs at pureftpd dot org Assigned: pajoye
Status: Closed Package: GD related
PHP Version: 5CVS-2005-08-17 OS: *
Private report: No CVE-ID:
 [2005-06-02 15:11 UTC] phpbugs at pureftpd dot org
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:

Get kaboom-gd.gif from

Expected result:
No 100% CPU usage. 

Actual result:
100% CPU usage, infinite loop. 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-24 12:23 UTC]
I've made a patch to fix this problem:

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-09-24 16:42 UTC]
Patch applied in all active branches. I keep this bug as 'assigned' as there is other cases which cause an infinite loop.
 [2005-11-06 23:21 UTC]
Pierre, are there still open issues in this report? If not, close this. Open separate reports for separate issues!

 [2005-12-07 00:54 UTC]
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Sat Nov 28 07:01:37 2015 UTC