Index: trunk/magic/remove/src/Line.c
===================================================================
--- trunk/magic/remove/src/Line.c	(revision 20664)
+++ trunk/magic/remove/src/Line.c	(revision 21156)
@@ -321,9 +321,11 @@
                 if (DistanceSquared (line, x, y) <= halfWidth2)
                 {
-                    pixel = psAlloc (sizeof(PixelPos));
-                    pixel->x = (int) x;
-                    pixel->y = (int) y;
-                    psArrayAdd (pixels, 1024, pixel);
-                    psFree (pixel);
+                    if (x >=0 && y >= 0) {
+                        pixel = psAlloc (sizeof(PixelPos));
+                        pixel->x = (unsigned int) x;
+                        pixel->y = (unsigned int) y;
+                        psArrayAdd (pixels, 1024, pixel);
+                        psFree (pixel);
+                    }
                 }
             }
@@ -368,9 +370,11 @@
                 if (DistanceSquared (line, x, y) <= halfWidth2)
                 {
-                    pixel = psAlloc (sizeof(PixelPos));
-                    pixel->x = (int) x;
-                    pixel->y = (int) y;
-                    psArrayAdd (pixels, 1024, pixel);
-                    psFree (pixel);
+                    if (x >=0 && y >= 0) {
+                        pixel = psAlloc (sizeof(PixelPos));
+                        pixel->x = (unsigned int) x;
+                        pixel->y = (unsigned int) y;
+                        psArrayAdd (pixels, 1024, pixel);
+                        psFree (pixel);
+                    }
                 }
             }
