]> granicus.if.org Git - php/commitdiff
- Fix sanity check for the color index in imagecolortransparent
authorPierre Joye <pajoye@php.net>
Thu, 3 Sep 2009 09:45:56 +0000 (09:45 +0000)
committerPierre Joye <pajoye@php.net>
Thu, 3 Sep 2009 09:45:56 +0000 (09:45 +0000)
NEWS
ext/gd/libgd/gd.c

diff --git a/NEWS b/NEWS
index 0b6f351facd40b3040d27e99ea12b72171d84596..cc7c9c1abdfde88acb6aeefdefad70c48277b7cf 100644 (file)
--- 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.
index 5b4f92359663b8e3c88db75eadb8b214819d00db..a0ea6f198a272a3b71a59ea8095c951c65e3c075 100644 (file)
@@ -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;