summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemi Collet <remi@php.net>2016-01-12 13:54:23 +0100
committerRemi Collet <remi@php.net>2016-01-12 13:54:23 +0100
commitaf3f3be0c14f4b4b68edf7db3d666e79ff813f71 (patch)
treeaa4fe5e8083457f2c01e36d19301de9ee25d2991
parent224aaf94af8f06a241d023bf58533dc6db6d9d1f (diff)
parent14e4d393cf07a43fc68853e6d9cd9440a950d002 (diff)
downloadphp-git-af3f3be0c14f4b4b68edf7db3d666e79ff813f71.tar.gz
Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6: fix the fix for bug #70976 (imagerotate) Use php_session_abort()
-rw-r--r--ext/gd/libgd/gd_interpolation.c4
-rw-r--r--ext/gd/tests/bug70976.phpt4
2 files changed, 4 insertions, 4 deletions
diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c
index a946e04b4d..a06e333add 100644
--- a/ext/gd/libgd/gd_interpolation.c
+++ b/ext/gd/libgd/gd_interpolation.c
@@ -2162,7 +2162,7 @@ gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, in
{
const int angle_rounded = (int)floor(angle * 100);
- if (bgcolor < 0 || (!src->trueColor && bgcolor >= gdMaxColors)) {
+ if (bgcolor < 0) {
return NULL;
}
@@ -2170,7 +2170,7 @@ gdImagePtr gdImageRotateInterpolated(const gdImagePtr src, const float angle, in
images can be done at a later point.
*/
if (src->trueColor == 0) {
- if (bgcolor >= 0) {
+ if (bgcolor < gdMaxColors) {
bgcolor = gdTrueColorAlpha(src->red[bgcolor], src->green[bgcolor], src->blue[bgcolor], src->alpha[bgcolor]);
}
gdImagePaletteToTrueColor(src);
diff --git a/ext/gd/tests/bug70976.phpt b/ext/gd/tests/bug70976.phpt
index 23af4eedc7..dfbd4b49ec 100644
--- a/ext/gd/tests/bug70976.phpt
+++ b/ext/gd/tests/bug70976.phpt
@@ -6,8 +6,8 @@ Bug #70976 (Memory Read via gdImageRotateInterpolated Array Index Out of Bounds)
?>
--FILE--
<?php
-$img = imagerotate(imagecreate(1,1),45,0x7ffffff9);
+$img = imagerotate(imagecreate(10,10),45,0x7ffffff9);
var_dump($img);
?>
--EXPECTF--
-bool(false) \ No newline at end of file
+resource(5) of type (gd) \ No newline at end of file