Merge branch 'PHP-7.0' into PHP-7.1

This commit is contained in:
Christoph M. Becker 2016-10-25 14:34:43 +02:00
commit c30e5a32c1
3 changed files with 21 additions and 1 deletions

3
NEWS
View file

@ -546,7 +546,8 @@ PHP NEWS
(Pierre)
. Fixed bug #72482 (Ilegal write/read access caused by gdImageAALine
overflow). (Pierre)
. Fixed bug #72494 (imagecropauto out-of-bounds access). (Pierre)
. Fixed bug #72494 (imagecropauto out-of-bounds access). (Fernando, Pierre,
cmb)
- Intl:
. Partially fixed #72506 (idn_to_ascii for UTS #46 incorrect for long domain

View file

@ -243,6 +243,10 @@ gdImagePtr gdImageCropThreshold(gdImagePtr im, const unsigned int color, const f
return NULL;
}
if (!gdImageTrueColor(im) && color >= gdImageColorsTotal(im)) {
return NULL;
}
/* TODO: Add gdImageGetRowPtr and works with ptr at the row level
* for the true color and palette images
* new formats will simply work with ptr

View file

@ -0,0 +1,15 @@
--TEST--
Bug #72494 (imagecropauto out-of-bounds access)
--SKIPIF--
<?php
if (!extension_loaded('gd')) die('skip gd extension not available');
?>
--FILE--
<?php
$im = imagecreate(10,10);
imagecropauto($im, IMG_CROP_THRESHOLD, 0, 1337);
?>
===DONE===
--EXPECTF--
Warning: imagecropauto(): Color argument missing with threshold mode in %s on line %d
===DONE===