From: Pierre Joye Date: Tue, 19 Jul 2016 11:23:51 +0000 (+0700) Subject: fix #72494, improve input color check and prevent issues when old gd are used, done... X-Git-Tag: php-7.1.0beta1~25^2~1^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1d69028d2f15216d128b5a6e606f763ef09d4991;p=php fix #72494, improve input color check and prevent issues when old gd are used, done before gd call --- diff --git a/ext/gd/gd.c b/ext/gd/gd.c index b843bda98d..533dc502ca 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -5116,7 +5116,7 @@ PHP_FUNCTION(imagecropauto) break; case GD_CROP_THRESHOLD: - if (color < 0) { + if (color < 0 || (!gdImageTrueColor(im) && color >= gdImageColorsTotal(im))) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Color argument missing with threshold mode"); RETURN_FALSE; }