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
commit8f8220917e30ddd0c5fa0956581f0b4f00d90d9f (patch)
tree2915bcf4593e4864885bfd3895bd71b29e62ec39
parenta8c40d5b3aa67b80dde2c2faa69e80353b43a22d (diff)
downloadphp-git-8f8220917e30ddd0c5fa0956581f0b4f00d90d9f.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 0b6f351fac..cc7c9c1abd 100644
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,7 @@ PHP NEWS
- Improved shared extension loading on OSX to use the standard Unix dlopen()
API. (Scott)
+- Fixed sanity check for the color index in imagecolortransparent. (Pierre)
- Fixed scandir/readdir when used mounted points on Windows. (Pierre)
- Fixed zlib.deflate compress filter to actually accept level parameter. (Jani)
- Fixed leak on error in popen/exec (and related functions) on Windows.
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c
index 5b4f923596..a0ea6f198a 100644
--- a/ext/gd/libgd/gd.c
+++ b/ext/gd/libgd/gd.c
@@ -595,7 +595,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;