Index: /trunk/psphot/src/psphotSourceSize.c
===================================================================
--- /trunk/psphot/src/psphotSourceSize.c	(revision 29609)
+++ /trunk/psphot/src/psphotSourceSize.c	(revision 29610)
@@ -693,4 +693,10 @@
     LIMIT_YRANGE(ys, mask);
     LIMIT_YRANGE(ye, mask);
+
+    // the peak must be contained in the mask..
+    if (peak->x < xs) return false;
+    if (peak->y < ys) return false;
+    if (peak->x >= xe) return false;
+    if (peak->y >= ye) return false;
 
     int dx = xe - xs;
