Patch bug72512 for GD related Bug #72512
Patch version 2016-06-29 09:52 UTC
Return to Bug #72512 |
Download this patch
Patch Revisions:
Developer: pajoye@php.net
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c
index a5799c5..170e372 100644
--- a/ext/gd/libgd/gd.c
+++ b/ext/gd/libgd/gd.c
@@ -599,15 +599,18 @@ void gdImageColorDeallocate (gdImagePtr im, int color)
void gdImageColorTransparent (gdImagePtr im, int color)
{
+ if (color < 0) {
+ return;
+ }
+
if (!im->trueColor) {
+ if((color >= gdMaxColors)) {
+ return;
+ }
if (im->transparent != -1) {
im->alpha[im->transparent] = gdAlphaOpaque;
}
- if (color > -1 && color < im->colorsTotal && color < gdMaxColors) {
- im->alpha[color] = gdAlphaTransparent;
- } else {
- return;
- }
+ im->alpha[color] = gdAlphaTransparent;
}
im->transparent = color;
}
|