summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2001-09-27 07:39:24 +0000
committerRasmus Lerdorf <rasmus@php.net>2001-09-27 07:39:24 +0000
commitc5bf17f0a583caf127665430ece4be7068014541 (patch)
tree098f15a322e1718f1e3fe4e52b6908a34b26f4d2
parent730359dc4dc0b95c09229821d3350552727622f0 (diff)
downloadphp-git-c5bf17f0a583caf127665430ece4be7068014541.tar.gz
MFH
-rw-r--r--ext/gd/gd.c8
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