From c02301b666f61e73da3ae73f712823cf64a9299d Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Tue, 19 Apr 2016 23:44:00 -0700 Subject: [PATCH] Better fix for #71952 --- ext/gd/gd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ext/gd/gd.c b/ext/gd/gd.c index df0a32f1ab..0fce8ddcdf 100644 --- a/ext/gd/gd.c +++ b/ext/gd/gd.c @@ -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); -- 2.40.0