summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2010-04-28 14:35:42 +0000
committerPierre Joye <pajoye@php.net>2010-04-28 14:35:42 +0000
commitef76df031bd26ff25de32cabb4703037b29fe4fe (patch)
tree5cc64cb52d6cb73e196c0409431d2440ee3be186
parent68e0e88610aa5021aaaaabd7a76464cb92d0ec51 (diff)
downloadphp-git-ef76df031bd26ff25de32cabb4703037b29fe4fe.tar.gz
- - Fixed #51128, imagefill() doesn't work with large images
-rw-r--r--ext/gd/libgd/gd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/gd/libgd/gd.c b/ext/gd/libgd/gd.c
index 0510bec14e..0cc2e1d7de 100644
--- a/ext/gd/libgd/gd.c
+++ b/ext/gd/libgd/gd.c
@@ -1845,9 +1845,9 @@ void gdImageFillToBorder (gdImagePtr im, int x, int y, int border, int color)
struct seg {int y, xl, xr, dy;};
/* max depth of stack */
-#define FILL_MAX 1200000
+#define FILL_MAX ((int)(im->sy*im->sx)/4)
#define FILL_PUSH(Y, XL, XR, DY) \
- if (sp<stack+FILL_MAX*10 && Y+(DY)>=0 && Y+(DY)<wy2) \
+ if (sp<stack+FILL_MAX && Y+(DY)>=0 && Y+(DY)<wy2) \
{sp->y = Y; sp->xl = XL; sp->xr = XR; sp->dy = DY; sp++;}
#define FILL_POP(Y, XL, XR, DY) \