From: Christoph M. Becker Date: Mon, 6 Jan 2020 09:33:47 +0000 (+0100) Subject: Fix #79068: gdTransformAffineCopy() changes interpolation method X-Git-Tag: php-7.3.14RC1~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4bec59f1751d9d1e302465b68cceffb8df93a7be;p=php Fix #79068: gdTransformAffineCopy() changes interpolation method We port . --- diff --git a/NEWS b/NEWS index bb7dd649db..08f0f5b2db 100644 --- a/NEWS +++ b/NEWS @@ -25,6 +25,8 @@ PHP NEWS . Fixed bug #78923 (Artifacts when convoluting image with transparency). (wilson chen) . Fixed bug #79067 (gdTransformAffineCopy() may use unitialized values). (cmb) + . Fixed bug #79068 (gdTransformAffineCopy() changes interpolation method). + (cmb) - Libxml: . Fixed bug #79029 (Use After Free's in XMLReader / XMLWriter). (Laruence) diff --git a/ext/gd/libgd/gd_interpolation.c b/ext/gd/libgd/gd_interpolation.c index 489f3c9694..d723e652a8 100644 --- a/ext/gd/libgd/gd_interpolation.c +++ b/ext/gd/libgd/gd_interpolation.c @@ -2351,7 +2351,7 @@ int gdTransformAffineCopy(gdImagePtr dst, gdPointF pt, src_pt; gdRect bbox; int end_x, end_y; - gdInterpolationMethod interpolation_id_bak = GD_DEFAULT; + gdInterpolationMethod interpolation_id_bak = src->interpolation_id; interpolation_method interpolation_bak; /* These methods use special implementations */ diff --git a/ext/gd/tests/bug79068.phpt b/ext/gd/tests/bug79068.phpt new file mode 100644 index 0000000000..391424b119 --- /dev/null +++ b/ext/gd/tests/bug79068.phpt @@ -0,0 +1,21 @@ +--TEST-- +Bug #79068 (gdTransformAffineCopy() changes interpolation method) +--SKIPIF-- + +--FILE-- + +--EXPECT-- +The images are equal. diff --git a/ext/gd/tests/bug79068.png b/ext/gd/tests/bug79068.png new file mode 100644 index 0000000000..805edc1c56 Binary files /dev/null and b/ext/gd/tests/bug79068.png differ