[EMAIL PROTECTED] (Lars Magne Ingebrigtsen) writes:

> php-4.0.4pl1 compiled with --with-t1lib alternatively segfaults or
> gives error messages, depending on where you call ImagePsText(). 

I don't know anything about php's internals, but since 4.0.3 worked,
and 4.0.4pl1 didn't I just compared the two versions of the function.
The following patch fixes the segfault problem for me:

--- gd.c~       Wed Nov 29 16:25:42 2000
+++ gd.c        Sun Apr  8 06:45:44 2001
@@ -2390,6 +2390,7 @@
                if (zend_get_parameters_ex(12, &img, &str, &fnt, &sz, &fg, &bg,\
 &px, &py, &sp, &wd, &ang, &aas) == FAILURE) {
                        RETURN_FALSE;
                }
+               convert_to_string_ex(str);
                convert_to_long_ex(sp);
                convert_to_long_ex(aas);
                convert_to_long_ex(wd);

The other problem (the warning) was due to me calling ImagePsText with
a non-integer px or py parameter.  I'm guessing it's a bug that gd.c
doesn't coerce those parameters to integers, but I leave that to
others to fix.

-- 
(domestic pets only, the antidote for overdose, milk.)
   [EMAIL PROTECTED] * Lars Magne Ingebrigtsen

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to