From: Remi Collet Date: Mon, 3 Jun 2013 12:15:18 +0000 (+0200) Subject: Fixed Bug #64961 segfault in imagesetinterpolation X-Git-Tag: php-5.5.0RC3~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=99ea60c2ddafcbd6daf4af766da51d28e167999b;p=php Fixed Bug #64961 segfault in imagesetinterpolation enum type are not long ;) so cannot be used as zend_parse_parameters arg. --- diff --git a/ext/gd/gd.c b/ext/gd/gd.c index d6d2848d41..73434307c6 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -5212,7 +5212,7 @@ PHP_FUNCTION(imageaffine) PHP_FUNCTION(imageaffinematrixget) { double affine[6]; - gdAffineStandardMatrix type; + long type; zval *options; zval **tmp; int res = GD_FALSE, i; @@ -5221,7 +5221,7 @@ PHP_FUNCTION(imageaffinematrixget) return; } - switch(type) { + switch((gdAffineStandardMatrix)type) { case GD_AFFINE_TRANSLATE: case GD_AFFINE_SCALE: { double x, y; @@ -5271,7 +5271,7 @@ PHP_FUNCTION(imageaffinematrixget) } default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %i", type); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid type for element %li", type); RETURN_FALSE; } @@ -5361,7 +5361,7 @@ PHP_FUNCTION(imagesetinterpolation) { zval *IM; gdImagePtr im; - gdInterpolationMethod method = GD_BILINEAR_FIXED; + long method = GD_BILINEAR_FIXED; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &IM, &method) == FAILURE) { return;