From f7ff0903ff9e87caadd70df6dece0bf2b9d88fdb Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Fri, 16 Oct 2009 22:06:34 +0200 Subject: [PATCH] Fix a width/height confusion in the healing tool algorithm As pointed out by Massimo Valentini in bug #519503, the code used height where width should have been used. Correct. --- app/paint/gimpheal.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/paint/gimpheal.c b/app/paint/gimpheal.c index 5b7021cd7b..fb17af6fad 100644 --- a/app/paint/gimpheal.c +++ b/app/paint/gimpheal.c @@ -300,17 +300,18 @@ gimp_heal_laplace_iteration (gdouble *matrix, gdouble *solution, guchar *mask) { - gint rowstride = width * depth; - gint i, j, k; - gdouble tmp, diff; - gdouble err = 0.0; + const gint rowstride = width * depth; + gint i, j, k; + gdouble tmp, diff; + gdouble err = 0.0; for (i = 0; i < height; i++) { for (j = 0; j < width; j++) { - if ((0 == *mask) || (i == 0) || (i == (height - 1)) || - (j == 0) || (j == (height - 1))) + if ((0 == *mask) || + (i == 0) || (i == (height - 1)) || + (j == 0) || (j == (width - 1))) { /* do nothing at the boundary or outside mask */ for (k = 0; k < depth; k++)