diff options
author | Peter Cowburn <salathe@php.net> | 2019-09-04 21:42:43 +0100 |
---|---|---|
committer | Peter Cowburn <salathe@php.net> | 2019-09-09 21:06:00 +0100 |
commit | a43679632b97b513d6e2913d90e24d0915e1b486 (patch) | |
tree | 7d17a9cba631ba15923cf5986054ff60446858eb /ext/gd/gd.c | |
parent | bc6199757168eee4bd1d0a0d28a36c242bdcf13d (diff) | |
download | php-git-a43679632b97b513d6e2913d90e24d0915e1b486.tar.gz |
raise ValueError from imagecreate/imagecreatetruecolor
Raise a ValueError instead of a plain Error when calling imagecreate()
or imagecreatetruecolor() with too big or small values for the width or
height arguments.
Diffstat (limited to 'ext/gd/gd.c')
-rw-r--r-- | ext/gd/gd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c index b0215386d9..608f350c2f 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -829,12 +829,12 @@ PHP_FUNCTION(imagecreatetruecolor) } if (x_size <= 0 || x_size >= INT_MAX) { - zend_throw_error(NULL, "Invalid width (x_size)"); + zend_value_error("Invalid width (x_size)"); return; } if (y_size <= 0 || y_size >= INT_MAX) { - zend_throw_error(NULL, "Invalid height (y_size)"); + zend_value_error("Invalid height (y_size)"); return; } @@ -1473,12 +1473,12 @@ PHP_FUNCTION(imagecreate) } if (x_size <= 0 || x_size >= INT_MAX) { - zend_throw_error(NULL, "Invalid width (x_size)"); + zend_value_error("Invalid width (x_size)"); return; } if (y_size <= 0 || y_size >= INT_MAX) { - zend_throw_error(NULL, "Invalid height (y_size)"); + zend_value_error("Invalid height (y_size)"); return; } |