mirror of
https://github.com/php/php-src.git
synced 2025-01-23 20:23:31 +08:00
Merge branch 'PHP-5.6' into PHP-7.0
This commit is contained in:
commit
af4bfe234c
2
NEWS
2
NEWS
@ -377,6 +377,8 @@ PHP NEWS
|
||||
. Fixed bug #68712 (suspicious if-else statements). (cmb)
|
||||
. Fixed bug #72697 (select_colors write out-of-bounds). (Stas)
|
||||
. Fixed bug #72730 (imagegammacorrect allows arbitrary write access). (Stas)
|
||||
. Fixed bug #72494 (imagecropauto out-of-bounds access). (Fernando, Pierre,
|
||||
cmb)
|
||||
|
||||
- Intl:
|
||||
. Fixed bug #72639 (Segfault when instantiating class that extends
|
||||
|
@ -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
|
||||
|
15
ext/gd/tests/bug72494.phpt
Normal file
15
ext/gd/tests/bug72494.phpt
Normal 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===
|
Loading…
Reference in New Issue
Block a user