From:             jpgraph at aditus dot nu
Operating system: Linux
PHP version:      4.3.6
PHP Bug Type:     Reproducible crash
Bug description:  Bundled GD2 crashes when antialias is enabled

Description:
------------
Bundled GD2 in 4.3.4, 4.3.5 and 4.3.6 crashes when antialias is enabled.

When antialias is enabled through the imageantialias($img,$flag) function
then the Apache process crashes when trying to paint a line at the edge of
the image.

This is reproducible 100% using Apache 1.3.28 on our setup. If antialias
is disabled everything works fine.

It seems to be a boundary problem on the edge of the image. See example
below.





Reproduce code:
---------------
<?php
// 
// This script will generate a Seg Fault on Linux
//
$im  = imagecreatetruecolor(300, 300);
$w  = imagecolorallocate($im, 255, 255, 255);
$red = imagecolorallocate($im, 255, 0, 0);

imagefilledrectangle($im,0,0,299,299,$w);

imageantialias($im,true);
imageline($im, 299, 299, 0, 299, $red);

header("Content-type: image/png");
imagepng($im);
imagedestroy($im);
?>

Expected result:
----------------
A line from bottom right corner to bottom left corner.

Actual result:
--------------
PHP Segmentation fault

-- 
Edit bug report at http://bugs.php.net/?id=28147&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=28147&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=28147&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=28147&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=28147&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=28147&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=28147&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=28147&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=28147&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=28147&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=28147&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=28147&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=28147&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28147&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=28147&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=28147&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=28147&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28147&r=float

Reply via email to