]> granicus.if.org Git - php/commitdiff
Better fix for #71952
authorStanislav Malyshev <stas@php.net>
Wed, 20 Apr 2016 06:44:00 +0000 (23:44 -0700)
committerStanislav Malyshev <stas@php.net>
Wed, 20 Apr 2016 06:44:00 +0000 (23:44 -0700)
ext/gd/gd.c

index df0a32f1ab3938fdecb08e6aee08ebcce29ffa75..0fce8ddcdf2544bbc9305bac5643c8aea2dd2a04 100644 (file)
@@ -5363,10 +5363,14 @@ PHP_FUNCTION(imageaffinematrixget)
                                RETURN_FALSE;
                        }
                        if(Z_TYPE_P(options) != IS_DOUBLE) {
-                               Z_ADDREF_P(options);
-                               convert_to_double_ex(&options);
+                               zval dval;
+                               dval = *options;
+                               zval_copy_ctor(&dval);
+                               convert_to_double(&dval);
+                               angle = Z_DVAL(dval);
+                       } else {
+                               angle = Z_DVAL_P(options);
                        }
-                       angle = Z_DVAL_P(options);
 
                        if (type == GD_AFFINE_SHEAR_HORIZONTAL) {
                                res = gdAffineShearHorizontal(affine, angle);