pajoye                                   Wed, 28 Apr 2010 14:35:42 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=298701

Log:
- - Fixed #51128, imagefill() doesn't work with large images

Bug: http://bugs.php.net/51128 (Assigned) imagefill() doesn't work with large 
images
      
Changed paths:
    U   php/php-src/branches/PHP_5_2/NEWS
    U   php/php-src/branches/PHP_5_2/ext/gd/libgd/gd.c
    U   php/php-src/branches/PHP_5_3/NEWS
    U   php/php-src/branches/PHP_5_3/ext/gd/libgd/gd.c
    U   php/php-src/trunk/ext/gd/libgd/gd.c

Modified: php/php-src/branches/PHP_5_2/NEWS
===================================================================
--- php/php-src/branches/PHP_5_2/NEWS   2010-04-28 14:10:01 UTC (rev 298700)
+++ php/php-src/branches/PHP_5_2/NEWS   2010-04-28 14:35:42 UTC (rev 298701)
@@ -54,6 +54,7 @@
   (Ilia)
 - Fixed bug #51171 (curl_setopt() doesn't output any errors or warnings when
   an invalid option is provided). (Ilia)
+- Fixed bug #51128 (imagefill() doesn't work with large images). (Pierre)
 - Fixed bug #51086 (DBA DB4 doesn't work with Berkeley DB 4.8). (Chris Jones)
 - Fixed bug #51062 (DBA DB4 uses mismatched headers and libraries). (Chris 
Jones)
 - Fixed bug #51023 (filter doesn't detect int overflows with GCC 4.4).

Modified: php/php-src/branches/PHP_5_2/ext/gd/libgd/gd.c
===================================================================
--- php/php-src/branches/PHP_5_2/ext/gd/libgd/gd.c      2010-04-28 14:10:01 UTC 
(rev 298700)
+++ php/php-src/branches/PHP_5_2/ext/gd/libgd/gd.c      2010-04-28 14:35:42 UTC 
(rev 298701)
@@ -1938,9 +1938,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) \

Modified: php/php-src/branches/PHP_5_3/NEWS
===================================================================
--- php/php-src/branches/PHP_5_3/NEWS   2010-04-28 14:10:01 UTC (rev 298700)
+++ php/php-src/branches/PHP_5_3/NEWS   2010-04-28 14:35:42 UTC (rev 298701)
@@ -86,6 +86,7 @@
   (Felipe)
 - Fixed bug #51171 (curl_setopt() doesn't output any errors or warnings when
   an invalid option is provided). (Ilia)
+- Fixed bug #51128 (imagefill() doesn't work with large images). (Pierre)
 - Fixed bug #51096 ('last day' and 'first day' are handled incorrectly when
   parsing date strings). (Derick)
 - Fixed bug #51086 (DBA DB4 doesn't work with Berkeley DB 4.8). (Chris Jones)

Modified: php/php-src/branches/PHP_5_3/ext/gd/libgd/gd.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/gd/libgd/gd.c      2010-04-28 14:10:01 UTC 
(rev 298700)
+++ php/php-src/branches/PHP_5_3/ext/gd/libgd/gd.c      2010-04-28 14:35:42 UTC 
(rev 298701)
@@ -1845,9 +1845,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) \

Modified: php/php-src/trunk/ext/gd/libgd/gd.c
===================================================================
--- php/php-src/trunk/ext/gd/libgd/gd.c 2010-04-28 14:10:01 UTC (rev 298700)
+++ php/php-src/trunk/ext/gd/libgd/gd.c 2010-04-28 14:35:42 UTC (rev 298701)
@@ -1845,9 +1845,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) \

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to