Index: /trunk/psastro/src/psastroMaskUtils.c
===================================================================
--- /trunk/psastro/src/psastroMaskUtils.c	(revision 24044)
+++ /trunk/psastro/src/psastroMaskUtils.c	(revision 24045)
@@ -181,6 +181,15 @@
 bool psastroMaskEllipticalAnnulus (psImage *mask, psImageMaskType value, float x0, float y0, psEllipseAxes eInner, psEllipseAxes eOuter) {
 
+    // skip the masking if the outer ellipse is nonsensical
+    psEllipseShape sOuter = psEllipseAxesToShape (eOuter);
+    if (isnan(sOuter.sx) || isnan(sOuter.sy) || isnan(sOuter.sxy)) return false;
+
     psEllipseShape sInner = psEllipseAxesToShape (eInner);
-    psEllipseShape sOuter = psEllipseAxesToShape (eOuter);
+    if (isnan(sInner.sx) || isnan(sInner.sy) || isnan(sInner.sxy)) {
+	// use a solid ellipse if the inner ellipse is nonsensical
+	sInner.sx = 0.1;
+	sInner.sy = 0.1;
+	sInner.sxy = 0.0;
+    }
 
     // phi is the coordinate along the elliptical path
