Commit:    4e6d54f5a7003b73f12d86d7f5cba0a37ce40930
Author:    Pierre Joye <pierre....@gmail.com>         Fri, 22 Mar 2013 08:28:11 
+0100
Parents:   15ecea760284008ec755ab467f97d3987cca80fb
Branches:  master

Link:       
http://git.php.net/?p=php-src.git;a=commitdiff;h=4e6d54f5a7003b73f12d86d7f5cba0a37ce40930

Log:
- fix regression (imagerotate_overflow.phpt)

Changed paths:
  M  ext/gd/gd.c
  M  ext/gd/libgd/gd_interpolation.c


Diff:
diff --git a/ext/gd/gd.c b/ext/gd/gd.c
index caf84e3..e291793 100644
--- a/ext/gd/gd.c
+++ b/ext/gd/gd.c
@@ -83,6 +83,10 @@ static void php_free_ps_enc(zend_rsrc_list_entry *rsrc 
TSRMLS_DC);
 # endif
 #endif
 
+#if defined(HAVE_GD_XPM) && defined(HAVE_GD_BUNDLED)
+# include "X11/xpm.h"
+#endif
+
 #ifndef M_PI
 #define M_PI 3.14159265358979323846
 #endif
@@ -124,6 +128,10 @@ int gdImageColorClosestHWB(gdImagePtr im, int r, int g, 
int b);
 #define gdNewDynamicCtxEx(len, data, val) gdNewDynamicCtx(len, data)
 #endif
 
+/* as it is not really public, duplicate declaration here to avoid 
+   pointless warnings */
+int overflow2(int a, int b);
+
 /* Section Filters Declarations */
 /* IMPORTANT NOTE FOR NEW FILTER
  * Do not forget to update:
diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c
index 5ad5de6..c44f504 100644
--- a/ext/gd/libgd/gd_interpolation.c
+++ b/ext/gd/libgd/gd_interpolation.c
@@ -1750,6 +1750,10 @@ gdImagePtr gdImageRotateGeneric(gdImagePtr src, const 
float degrees, const int b
                                                        f_slop_x > f_slop_y ? 
gd_divfx(f_slop_y, f_slop_x) : gd_divfx(f_slop_x, f_slop_y)
                                                : 0;
 
+       if (bgColor < 0) {
+               return NULL;
+       }
+
        /* impact perf a bit, but not that much. Implementation for palette
           images can be done at a later point.
        */


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

Reply via email to