drop redundant color checks #456

These funcs were updated to always reject negative color values at
their start.  There's no need to keep these embedded negative checks.
master
Mike Frysinger 2018-08-31 01:22:32 -04:00
parent 4fc6d8a0d6
commit a6dd3491a0
1 changed files with 3 additions and 5 deletions

View File

@ -906,15 +906,13 @@ BGD_DECLARE(void) gdImageColorTransparent (gdImagePtr im, int color)
}
if (!im->trueColor) {
if((color < -1) || (color >= gdMaxColors)) {
if (color >= gdMaxColors) {
return;
}
if (im->transparent != -1) {
im->alpha[im->transparent] = gdAlphaOpaque;
}
if (color != -1) {
im->alpha[color] = gdAlphaTransparent;
}
im->alpha[color] = gdAlphaTransparent;
}
im->transparent = color;
}
@ -2277,7 +2275,7 @@ BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border,
}
if (!im->trueColor) {
if ((color > (im->colorsTotal - 1)) || (border > (im->colorsTotal - 1)) || (color < 0)) {
if (color > (im->colorsTotal - 1) || border > (im->colorsTotal - 1)) {
return;
}
}