]> 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 6b1de0909eab4fe6e30a446998013a876de1d4b4..9b942862cf3108e30fe99ac1ec3726584a322d4f 100644 (file)
--- 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)
 
index eb3668e2150f5cdcaf32132e876f732e659a0709..c375cea87659e1569919c6cdb59e7bfe74934071 100644 (file)
@@ -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;