php.net |  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
[php]
$im = ImageCreate(1000, 768);
ImageColorAllocate($im, 255, 255, 255);         
$color = ImageColorAllocate($im, 255, 255, 000);
ImageFillToBorder($im, 1500, 384, $color, $color);
[/php]

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/libgd.so.1
#1  0x401cef7e in gdImageFillToBorder () from /usr/lib/libgd.so.1
#2  0x401cf023 in gdImageFillToBorder () from /usr/lib/libgd.so.1
#3  0x401cf0a0 in gdImageFillToBorder () from /usr/lib/libgd.so.1
#4  0x401cf023 in gdImageFillToBorder () from /usr/lib/libgd.so.1

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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-03-30 14:48 UTC] iliaa@php.net
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 http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net 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: Fri Apr 19 03:01:27 2024 UTC