On Tue, Mar 16, 2010 at 10:54:45AM +0100, Jan Wagner wrote:

> Anyways ... indicating from your backtrace, your crashing function seems 
> imagepsfreefont() and not imagepstext(), as you mentioned ealier.

I have found the source of problem. It is chain of errors. It is right
that imagepstext() fail. Why? Because it take boolean "FALSE" instead of
image resource as first parameter. This value is returned by
imagecreate() where height and width is calculated from imagepsbbox(),
but this last function return wrong value for left x-coordinate if
mt_rand() is used to generate random angle. Don't understand why. Here
is short example:

<?php
$size = 64;
$code = ($argv[1]) ? $argv[1] : date("r");
$angle = 0;
$angle = mt_rand(20,40)*((mt_rand(0,1)) ? 1 : -1);
print "\$angle = " . $angle . "\n";
$font = imagepsloadfont("/usr/share/fonts/type1/gsfonts/c059036l.pfb");
print_r(imagepsbbox( $code, $font, $size, 0, 0, $angle ));
?>

But when purge suhosin this problem go away. Thus there are something
wrong in mt_rand() in conjunction with suhosin.

-- 

*********************************
****   Vladimir Stavrinov  ******
*******   [email protected]   *********
*********************************




-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to