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
parent
4fc6d8a0d6
commit
a6dd3491a0
8
src/gd.c
8
src/gd.c
|
@ -906,15 +906,13 @@ BGD_DECLARE(void) gdImageColorTransparent (gdImagePtr im, int color)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!im->trueColor) {
|
if (!im->trueColor) {
|
||||||
if((color < -1) || (color >= gdMaxColors)) {
|
if (color >= gdMaxColors) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (im->transparent != -1) {
|
if (im->transparent != -1) {
|
||||||
im->alpha[im->transparent] = gdAlphaOpaque;
|
im->alpha[im->transparent] = gdAlphaOpaque;
|
||||||
}
|
}
|
||||||
if (color != -1) {
|
im->alpha[color] = gdAlphaTransparent;
|
||||||
im->alpha[color] = gdAlphaTransparent;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
im->transparent = color;
|
im->transparent = color;
|
||||||
}
|
}
|
||||||
|
@ -2277,7 +2275,7 @@ BGD_DECLARE(void) gdImageFillToBorder (gdImagePtr im, int x, int y, int border,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!im->trueColor) {
|
if (!im->trueColor) {
|
||||||
if ((color > (im->colorsTotal - 1)) || (border > (im->colorsTotal - 1)) || (color < 0)) {
|
if (color > (im->colorsTotal - 1) || border > (im->colorsTotal - 1)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue