Commits

Ondřej Surý committed f2a06dd

Pull fix for PHP bug #64898

Comments (0)

Files changed (2)

src/gd_interpolation.c

 				const gdFixed f_w3 = gd_mulfx(f_f, f_1-f_g);
 				const gdFixed f_w4 = gd_mulfx(f_f, f_g);
 
-				/* The last condition is always true because the if ^^^ */
-				/* if (n < src_w - 1) { */
-				/* 	src_offset_x = m + 1; */
-				/* 	src_offset_y = n; */
-				/* } */
-
-				/* if (m < src_h - 1) { */
-				/* 	src_offset_x = m; */
-				/* 	src_offset_y = n + 1; */
-				/* } */
-
-				/* if (!((n >= src_w - 1) || (m >= src_h - 1))) { */
-					src_offset_x = m + 1;
-					src_offset_y = n + 1;
-				/* } */
+				if (n < src_w - 1) {
+					src_offset_x = n + 1;
+					src_offset_y = m;
+				}
+
+				if (m < src_h - 1) {
+					src_offset_x = n;
+					src_offset_y = m + 1;
+				}
+
+				if (!((n >= src_w - 1) || (m >= src_h - 1))) {
+					src_offset_x = n + 1;
+					src_offset_y = m + 1;
+				}
 				{
 					const int pixel1 = src->tpixels[src_offset_y][src_offset_x];
 					register int pixel2, pixel3, pixel4;

tests/gdinterpolation/php_bug_64898_exp.png

Old
Old image
New
New image