summaryrefslogtreecommitdiff
path: root/ext/gd
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2004-03-13 18:28:19 +0000
committerPierre Joye <pajoye@php.net>2004-03-13 18:28:19 +0000
commit9fc9639c83199c198d6948ec9a8b3cf19810ac69 (patch)
tree3e5d0b06aad0966f490c4894444555a16c382342 /ext/gd
parente3c0e33f11293555a1bfcfe40a1759bb47038c1f (diff)
downloadphp-git-9fc9639c83199c198d6948ec9a8b3cf19810ac69.tar.gz
- fix #27582 (http://bugs.php.net/bug.php?id=27582)
The problem was that the colors were changed endlessly, blending over and over. An endless loop and recursive calls filled the stack=>segfault
Diffstat (limited to 'ext/gd')
-rw-r--r--ext/gd/libgd/gd.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c
index 1459f4cb5f..cff22915a0 100644
--- a/ext/gd/libgd/gd.c
+++ b/ext/gd/libgd/gd.c
@@ -1760,13 +1760,18 @@ void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
int lastBorder;
/* Seek left */
int leftLimit = -1, rightLimit;
- int i;
+ int i, restoreAlphaBleding=0;
if (border < 0) {
/* Refuse to fill to a non-solid border */
return;
}
+ if (im->alphaBlendingFlag) {
+ restoreAlphaBleding = 1;
+ im->alphaBlendingFlag = 0;
+ }
+
if (x >= im->sx) {
x = im->sx - 1;
}
@@ -1809,6 +1814,7 @@ void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
}
}
}
+
/* Below */
if (y < ((im->sy) - 1)) {
lastBorder = 1;
@@ -1825,8 +1831,11 @@ void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
}
}
}
-}
+ if (restoreAlphaBleding) {
+ im->alphaBlendingFlag = 1;
+ }
+}
/*
* set the pixel at (x,y) and its 4-connected neighbors