diff options
author | Rasmus Lerdorf <rasmus@php.net> | 2001-09-27 07:39:24 +0000 |
---|---|---|
committer | Rasmus Lerdorf <rasmus@php.net> | 2001-09-27 07:39:24 +0000 |
commit | c5bf17f0a583caf127665430ece4be7068014541 (patch) | |
tree | 098f15a322e1718f1e3fe4e52b6908a34b26f4d2 | |
parent | 730359dc4dc0b95c09229821d3350552727622f0 (diff) | |
download | php-git-c5bf17f0a583caf127665430ece4be7068014541.tar.gz |
MFH
-rw-r--r-- | ext/gd/gd.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 3526ae0ee6..389bf343b3 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -1577,10 +1577,16 @@ PHP_FUNCTION(imagecolorat) ZEND_FETCH_RESOURCE(im, gdImagePtr, IM, -1, "Image", le_gd); +#if HAVE_LIBGD20 + if(im->truecolor) { + php_error(E_WARNING, "ImageColorAt does not work on TrueColor images"); + RETURN_FALSE; + } +#endif convert_to_long_ex(x); convert_to_long_ex(y); - if (gdImageBoundsSafe(im, Z_LVAL_PP(x), Z_LVAL_PP(y))) { + if (im->pixels && gdImageBoundsSafe(im, Z_LVAL_PP(x), Z_LVAL_PP(y))) { #if HAVE_LIBGD13 RETURN_LONG(im->pixels[Z_LVAL_PP(y)][Z_LVAL_PP(x)]); #else |