summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2009-09-03 09:45:56 +0000
committerPierre Joye <pajoye@php.net>2009-09-03 09:45:56 +0000
commit79868f856603d3cf4e8f0aff7c5e1303c8f1ecd7 (patch)
tree80df04d1f47347baf4819f75a796c18de22c2f5e
parente46f05a0a2b4cf48ef1ba9fce732ab27a8a0796c (diff)
downloadphp-git-79868f856603d3cf4e8f0aff7c5e1303c8f1ecd7.tar.gz
- Fix sanity check for the color index in imagecolortransparent
-rw-r--r--NEWS1
-rw-r--r--ext/gd/libgd/gd.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index 6b1de0909e..9b942862cf 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ PHP NEWS
?? ??? 2009, PHP 5.2.11
- Added missing sanity checks around exif processing (Ilia)
+- Fixed sanity check for the color index in imagecolortransparent. (Pierre)
- Fixed zlib.deflate compress filter to actually accept level parameter. (Jani)
- Fixed leak on error in popen/exec (and related functions on Windows. (Pierre)
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c
index eb3668e215..c375cea876 100644
--- a/ext/gd/libgd/gd.c
+++ b/ext/gd/libgd/gd.c
@@ -591,7 +591,7 @@ void gdImageColorTransparent (gdImagePtr im, int color)
if (im->transparent != -1) {
im->alpha[im->transparent] = gdAlphaOpaque;
}
- if (color > -1 && color<im->colorsTotal && color<=gdMaxColors) {
+ if (color > -1 && color < im->colorsTotal && color < gdMaxColors) {
im->alpha[color] = gdAlphaTransparent;
} else {
return;