diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c index 14dcc110c77..ff2b0596f56 100644 --- a/ext/gd/libgd/gd.c +++ b/ext/gd/libgd/gd.c @@ -754,7 +754,7 @@ int gdImageGetTrueColorPixel (gdImagePtr im, int x, int y) int p = gdImageGetPixel(im, x, y); if (!im->trueColor) { - return gdTrueColorAlpha(im->red[p], im->green[p], im->blue[p], (im->transparent == p) ? gdAlphaTransparent : gdAlphaOpaque); + return gdTrueColorAlpha(im->red[p], im->green[p], im->blue[p], (im->transparent == p) ? gdAlphaTransparent : im->alpha[p]); } else { return p; } diff --git a/ext/gd/tests/bug39273.phpt b/ext/gd/tests/bug39273.phpt new file mode 100644 index 00000000000..43845004475 --- /dev/null +++ b/ext/gd/tests/bug39273.phpt @@ -0,0 +1,32 @@ +--TEST-- +Bug #37360 (gdimagecreatefromgif, bad image sizes) +--SKIPIF-- + +--FILE-- + +--EXPECTF-- +32FF0000