]> granicus.if.org Git - php/commitdiff
- fix regression (imagerotate_overflow.phpt)
authorPierre Joye <pierre.php@gmail.com>
Fri, 22 Mar 2013 07:28:11 +0000 (08:28 +0100)
committerPierre Joye <pierre.php@gmail.com>
Fri, 22 Mar 2013 07:28:11 +0000 (08:28 +0100)
ext/gd/gd.c
ext/gd/libgd/gd_interpolation.c

index caf84e304e6fe6d0820b5eea6061947563702d83..e291793fd774f5ffd0c4e99ab6641632cc3826e2 100644 (file)
@@ -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:
index 5ad5de6268f8604f09a7e48515cecb5f6beb96a8..c44f5041067620c66af71ae3a687b9c5dd624a2d 100644 (file)
@@ -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.
        */