diff options
author | Remi Collet <remi@php.net> | 2014-03-12 13:44:58 +0100 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2014-03-12 13:44:58 +0100 |
commit | dada2f550f7f805cb4e111c0e13cf1da98e711be (patch) | |
tree | a702eee60b9a7a0bf8f6bc499c4a5c5650fcf459 | |
parent | f8252aa537e9a31d9b910f724cc5606b388ca0fb (diff) | |
download | php-git-dada2f550f7f805cb4e111c0e13cf1da98e711be.tar.gz |
Fixed Bug #66890 imagescale segfault
zend_parse_parameters "l" expect long, not int
-rw-r--r-- | ext/gd/gd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/gd/gd.c b/ext/gd/gd.c index 1058eaee5c..1b8366d58c 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -5102,12 +5102,16 @@ PHP_FUNCTION(imagescale) zval *IM; gdImagePtr im; gdImagePtr im_scaled; - int new_width, new_height = -1; - gdInterpolationMethod method = GD_BILINEAR_FIXED; + int new_width, new_height; + long tmp_w, tmp_h=-1, tmp_m = GD_BILINEAR_FIXED; + gdInterpolationMethod method; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|ll", &IM, &new_width, &new_height, &method) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl|ll", &IM, &tmp_w, &tmp_h, &tmp_m) == FAILURE) { return; } + method = tmp_m; + new_width = tmp_w; + new_height = tmp_h; ZEND_FETCH_RESOURCE(im, gdImagePtr, &IM, -1, "Image", le_gd); im_scaled = gdImageScale(im, new_width, new_height); |