php.net |  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
Votes:1
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 (profile)
Status: Closed Package: GD related
PHP Version: 5CVS-2005-08-17 OS: *
Private report: No CVE-ID: None
 [2005-06-02 15:11 UTC] 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. 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-09-24 12:23 UTC] 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-09-24 16:42 UTC] pajoye@php.net
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] sniper@php.net
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] iliaa@php.net
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at 
http://www.php.net/downloads.php


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 09 21:01:28 2024 UTC