]> granicus.if.org Git - php/commitdiff
Fixed Bug #64961 segfault in imagesetinterpolation
authorRemi Collet <remi@php.net>
Mon, 3 Jun 2013 12:15:18 +0000 (14:15 +0200)
committerRemi Collet <remi@php.net>
Mon, 3 Jun 2013 12:15:18 +0000 (14:15 +0200)
enum type are not long ;) so cannot be used as zend_parse_parameters arg.

ext/gd/gd.c

index d6d2848d41800dd081265de3d7d708b193c3009f..73434307c6db9c5156ce024080a4dc143aed290c 100644 (file)
@@ -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;