We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cab1c3b commit 7b2c226Copy full SHA for 7b2c226
ext/gd/libgd/gd.c
@@ -599,15 +599,18 @@ void gdImageColorDeallocate (gdImagePtr im, int color)
599
600
void gdImageColorTransparent (gdImagePtr im, int color)
601
{
602
+ if (color < 0) {
603
+ return;
604
+ }
605
+
606
if (!im->trueColor) {
607
+ if((color >= gdMaxColors)) {
608
609
610
if (im->transparent != -1) {
611
im->alpha[im->transparent] = gdAlphaOpaque;
612
}
- if (color > -1 && color < im->colorsTotal && color < gdMaxColors) {
- im->alpha[color] = gdAlphaTransparent;
- } else {
- return;
- }
613
+ im->alpha[color] = gdAlphaTransparent;
614
615
im->transparent = color;
616
0 commit comments