Merge branch 'PHP-5.6' into PHP-7.0

* PHP-5.6:
  fix the fix for bug #70976 (imagerotate)
  Use php_session_abort()
This commit is contained in:
Remi Collet 2016-01-12 13:54:23 +01:00
commit af3f3be0c1
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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)
resource(5) of type (gd)