Bug #1554: imagettfbbox causes segmentation fault
| From: | jradford at npl dot com | Date: | Wed, 16 Jun 1999 23:32:29 +0000 |
| Subject: | Bug #1554: imagettfbbox causes segmentation fault | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-7043@lists.php.net to get a copy of this message | ||
From: jradford@npl.com
Operating system: BSDI 4.0.1
PHP version: 3.0.9
PHP Bug Type: Reproduceable crash
Bug description: imagettfbbox causes segmentation fault
This code:
<?
Header( "Content-type: image/gif");
if(!isset($s)) $s=11;
$size = imagettfbbox(10,0, "/usr/local/fonts/TIMES.TTF",$text);
$dx = abs($size[2]-$size[0]);
$dy = abs($size[5]-$size[3]);
$xpad=9;
$ypad=9;
$im = imagecreate($dx+$xpad,$dy+$ypad);
$blue = ImageColorAllocate($im, 0x2c,0x6D,0xAF);
$black = ImageColorAllocate($im, 0,0,0);
$white = ImageColorAllocate($im, 255,255,255);
ImageRectangle($im,0,0,$dx+$xpad-1,$dy+$ypad-1,$black);
ImageRectangle($im,0,0,$dx+$xpad,$dy+$ypad,$white);
ImageTTFText($im, $s, 0, (int)($xpad/2)+1, $dy+(int)($ypad/2), $black,
"/usr/local/fonts/TIMES.TTF", $text);
ImageTTFText($im, $s, 0, (int)($xpad/2), $dy+(int)($ypad/2)-1, $white,
"/usr/local/fonts/TIMES.TTF", $text);
ImageGif($im);
ImageDestroy($im);
?>
It apparently is this line:
$size = imagettfbbox(10,0, "/usr/local/fonts/TIMES.TTF",$text);
causes A segmentation fault in apache's error_log, and of course the image is not displayed on
both php 3.0.7, and 3.0.9.
the php.ini is blank
do-conf:
./configure --with-apache=../apache_1.3.6 --with-gd --with-mysql --with-ldap=/usr/local --with-imap
--with-zlib
--enable-debug=no
Apache Modules:
Compiled-in modules:
http_core.c
mod_env.c
mod_log_config.c
mod_mime_magic.c
mod_mime.c
mod_negotiation.c
mod_status.c
mod_info.c
mod_include.c
mod_autoindex.c
mod_dir.c
mod_cgi.c
mod_asis.c
mod_imap.c
mod_actions.c
mod_speling.c
mod_userdir.c
mod_proxy.c
mod_alias.c
mod_rewrite.c
mod_access.c
mod_auth.c
mod_auth_anon.c
mod_auth_dbm.c
mod_digest.c
mod_cern_meta.c
mod_expires.c
mod_headers.c
mod_usertrack.c
mod_unique_id.c
mod_setenvif.c
mod_php3.c
mod_auth_mysql.c