Package: libgd2 / 2.0.36~rc1~dfsg-6.1+deb7u2

0003_fix_support_large_images.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Subject: Fix support large images
Origin: upstream, https://bugs.php.net/bug.php?id=51128
Bug: http://bugs.libgd.org/177
Bug-Debian: http://bugs.debian.org/595368
Last-Update: 20111015

--- a/gd.c
+++ b/gd.c
@@ -1893,9 +1893,9 @@
 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) \