- Fix sanity check for the color index in imagecolortransparent

This commit is contained in:
Pierre Joye 2009-09-03 09:45:56 +00:00
parent a8c40d5b3a
commit 8f8220917e
2 changed files with 2 additions and 1 deletions

1
NEWS
View File

@ -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.

View 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;