#45799 [Asn->Csd]: imagepng() crashes on empty image
ID: 45799
Updated by: tabe@php.net
Reported By: amelek32 at gmail dot com
-Status: Assigned
+Status: Closed
Bug Type: GD related
Operating System: *
PHP Version: 5.2.8, 5.3CVS, 6CVS (2008-12-09)
Assigned To: pajoye
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Thanks for your patch, from which I made a fix in 5.3 and 6CVS.
Previous Comments:
------------------------------------------------------------------------
[2009-03-10 11:25:43] mmcnicklebugs at googlemail dot com
[PATCH]
A to see if there are any colors associated with the image before
outputting the image header.
http://whompbox.com/patches/php/libgd.patch
------------------------------------------------------------------------
[2008-12-01 11:02:36] pajoye@php.net
My bad, you are right!
------------------------------------------------------------------------
[2008-12-01 11:00:46] amelek32 at gmail dot com
then
<?
$img = imagecreate(500,500);
@imagepng($img);
imagedestroy($img);
?>
should return empty page..
However, it do not ;)
------------------------------------------------------------------------
[2008-11-30 22:52:48] pajoye@php.net
Well, after a 2nd look, the warning will remain anyway. Whether it is
raised by libgd or php does not change anything > won't fix
------------------------------------------------------------------------
[2008-08-12 14:25:05] pajoye@php.net
> shouldn't it return warning without putting part of header to
output?
Hm, good point. I may add a check before calling the png function and
avoid to much troubles later. I will do it for 5.3+
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/45799
--
Edit this bug report at http://bugs.php.net/?id=45799&edit=1
Thread (9 messages)