Index: trunk/psModules/src/objects/pmSourceMatch.c
===================================================================
--- trunk/psModules/src/objects/pmSourceMatch.c	(revision 23241)
+++ trunk/psModules/src/objects/pmSourceMatch.c	(revision 23989)
@@ -473,4 +473,10 @@
         return -1;
     }
+    // XXX handle this case better:
+    if (isnan(stats->clippedMean))  {
+        psError(PS_ERR_UNKNOWN, false, "Unable to perform statistics on transparencies.");
+        psFree(stats);
+        return -1;
+    }
 
     float thresh = stats->clippedMean + photoLevel * stats->clippedStdev; // Threshold for clouds
