|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22965 Seg fault with ImageFillToBorder and ImageColorAllocate
Submitted: 2003-03-30 14:16 UTC Modified: 2003-03-30 14:48 UTC
From: php at cipri dot com Assigned:
Status: Closed Package: GD related
PHP Version: 4.3.2RC1 OS: Linux
Private report: No CVE-ID: None
 [2003-03-30 14:16 UTC] php at cipri dot com
$im = ImageCreate(1000, 768);
ImageColorAllocate($im, 255, 255, 255);         
$color = ImageColorAllocate($im, 255, 255, 000);
ImageFillToBorder($im, 1500, 384, $color, $color);

This will crash with a Seg-fault. After swapping the two lines with the ICA() call no crash happens.

PHP was compiled with:
./configure --enable-debug --with-gd=shared,/usr --with-png-dir=shared,/usr --with-zlib --with-zlib-dir=/usr

I then ran 
php -q ~/test.php 

It dumped a core, and when I ran a bt in gdb I got the following output.

#0  0x401ce59e in gdImageGetPixel () from /usr/lib/
#1  0x401cef7e in gdImageFillToBorder () from /usr/lib/
#2  0x401cf023 in gdImageFillToBorder () from /usr/lib/
#3  0x401cf0a0 in gdImageFillToBorder () from /usr/lib/
#4  0x401cf023 in gdImageFillToBorder () from /usr/lib/

After this, line 3 and 4 repeat indefinately, it seems.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-30 14:48 UTC]
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at
In case this was a documentation problem, the fix will show up soon at

In case this was a website problem, the change will show
up on the site and on the mirror sites in short time.
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 Mar 04 14:01:32 2024 UTC