|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28147 Bundled GD2 crashes when antialias is enabled
Submitted: 2004-04-25 21:12 UTC Modified: 2004-04-25 21:45 UTC
From: jpgraph at aditus dot nu Assigned: derick (profile)
Status: Closed Package: Reproducible crash
PHP Version: 4.3.6 OS: Linux
Private report: No CVE-ID: None
 [2004-04-25 21:12 UTC] jpgraph at aditus dot nu
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:
// 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);


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

header("Content-type: image/png");

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

Actual result:
PHP Segmentation fault


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-04-25 21:27 UTC]
Verified, and it's indeed an egde-issue.
 [2004-04-25 21:45 UTC]
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
Thank you for the report, and for helping us make PHP better.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Apr 15 17:01:32 2024 UTC