summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS2
-rw-r--r--ext/gd/libgd/gd_interpolation.c2
-rw-r--r--ext/gd/tests/bug79068.phpt21
-rw-r--r--ext/gd/tests/bug79068.pngbin0 -> 798 bytes
4 files changed, 24 insertions, 1 deletions
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--
+<?php
+if (!extension_loaded('gd')) die('skip gd extension not available');
+?>
+--FILE--
+<?php
+require_once __DIR__ . '/func.inc';
+
+$src = imagecreatetruecolor(100, 100);
+imagefilledrectangle($src, 0, 0, 99, 99, 0xffffff);
+imageline($src, 10, 10, 90, 90, 0x000000);
+imagesetinterpolation($src, IMG_BSPLINE);
+imageaffine($src, [1, 1, 1, 1, 1, 1]);
+$dst = imagerotate($src, 80, 0xffffff);
+
+test_image_equals_file(__DIR__ . '/bug79068.png', $dst);
+?>
+--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
--- /dev/null
+++ b/ext/gd/tests/bug79068.png
Binary files differ