From: cristy <urban-warrior@git.imagemagick.org>
Date: Fri, 4 Apr 2014 13:44:17 +0000 (+0000)
Subject: (no commit message)
X-Git-Tag: 7.0.1-0~2514
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1159cc5747e2df7afecb5a8dd56f7b48a483f680;p=imagemagick

---

diff --git a/MagickCore/effect.c b/MagickCore/effect.c
index 2f77e33d7..4c4b5ed52 100644
--- a/MagickCore/effect.c
+++ b/MagickCore/effect.c
@@ -933,18 +933,17 @@ static MagickBooleanType TraceEdge(Image *edge_image,CacheView *edge_view,
 
             for (u=(-1); u <= 1; u++)
             {
-              if (((y != 0) || (u != 0)) &&
-                  (IsAuthenticPixel(edge_image,x+u,y+v) != MagickFalse))
-                {
-                  (void) GetMatrixElement(pixel_cache,x+u,y+v,&pixel);
-                  if (pixel.intensity >= threshold)
-                    {
-                      status=TraceEdge(edge_image,edge_view,pixel_cache,x+u,y+v,
-                        threshold,exception);
-                      if (status != MagickFalse)
-                        return(MagickTrue);
-                    }
-                }
+              if ((u == 0) && (v == 0))
+                continue;
+              if (IsAuthenticPixel(edge_image,x+u,y+v) == MagickFalse)
+                continue;
+              (void) GetMatrixElement(pixel_cache,x+u,y+v,&pixel);
+              if (pixel.intensity < threshold)
+                continue;
+              status=TraceEdge(edge_image,edge_view,pixel_cache,x+u,y+v,
+                threshold,exception);
+              if (status != MagickFalse)
+                return(MagickTrue);
             }
           }
           return(MagickTrue);