mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Revert "Fix GH-16322: overflow on imageaffine matrix argument."
This reverts commit 05114265fb
.
This commit is contained in:
parent
05114265fb
commit
93a2fe8aac
1 changed files with 1 additions and 13 deletions
14
ext/gd/gd.c
14
ext/gd/gd.c
|
@ -3687,25 +3687,13 @@ PHP_FUNCTION(imageaffine)
|
|||
if ((zval_affine_elem = zend_hash_index_find(Z_ARRVAL_P(z_affine), i)) != NULL) {
|
||||
switch (Z_TYPE_P(zval_affine_elem)) {
|
||||
case IS_LONG:
|
||||
affine[i] = Z_LVAL_P(zval_affine_elem);
|
||||
if (ZEND_LONG_EXCEEDS_INT(affine[i])) {
|
||||
zend_argument_type_error(2, "element %i must be between %d and %d", i, INT_MIN, INT_MAX);
|
||||
RETURN_THROWS();
|
||||
}
|
||||
affine[i] = Z_LVAL_P(zval_affine_elem);
|
||||
break;
|
||||
case IS_DOUBLE:
|
||||
affine[i] = Z_DVAL_P(zval_affine_elem);
|
||||
if (ZEND_LONG_EXCEEDS_INT(affine[i])) {
|
||||
zend_argument_type_error(2, "element %i must be between %d and %d", i, INT_MIN, INT_MAX);
|
||||
RETURN_THROWS();
|
||||
}
|
||||
break;
|
||||
case IS_STRING:
|
||||
affine[i] = zval_get_double(zval_affine_elem);
|
||||
if (ZEND_LONG_EXCEEDS_INT(affine[i])) {
|
||||
zend_argument_type_error(2, "element %i must be between %d and %d", i, INT_MIN, INT_MAX);
|
||||
RETURN_THROWS();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
zend_argument_type_error(3, "contains invalid type for element %i", i);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue