components/php/php56/patches/CVE-2016-1903.patch
changeset 5658 b4ad53d98db3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/php/php56/patches/CVE-2016-1903.patch	Fri Mar 25 06:09:30 2016 -0700
@@ -0,0 +1,18 @@
+# Source: upstream
+# see: https://bugs.php.net/bug.php?id=70976
+# this fix (adapted):
+# https://github.com/php/php-src/commit/2baeb167a08b0186a885208bdc8b5871f1681dc8.diff
+
+diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c
+--- a/ext/gd/libgd/gd_interpolation.c
++++ b/ext/gd/libgd/gd_interpolation.c
+@@ -2154,7 +2154,7 @@ gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, in
+ {
+ 	const int angle_rounded = (int)floor(angle * 100);
+ 
+-	if (bgcolor < 0) {
++	if (bgcolor < 0 || (!src->trueColor && bgcolor >= gdMaxColors)) {
+ 		return NULL;
+ 	}
+ 
+