diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 63eb02d6af37f..2664288162a7a 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -2625,7 +2625,7 @@ void gdImageCopyResampled (gdImagePtr dst, gdImagePtr src, int dstX, int dstY, i red = red >= 255.5 ? 255 : red+0.5; blue = blue >= 255.5 ? 255 : blue+0.5; green = green >= 255.5 ? 255 : green+0.5; - alpha = alpha >= gdAlphaMax+0.5 ? 255 : alpha+0.5; + alpha = alpha >= gdAlphaMax+0.5 ? gdAlphaMax : alpha+0.5; gdImageSetPixel(dst, x, y, gdTrueColorAlpha ((int)red, (int)green, (int)blue, (int)alpha)); } }