Index: trunk/psModules/src/objects/pmSource.c
===================================================================
--- trunk/psModules/src/objects/pmSource.c	(revision 11261)
+++ trunk/psModules/src/objects/pmSource.c	(revision 11762)
@@ -6,6 +6,6 @@
  *  @author EAM, IfA: significant modifications.
  *
- *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-01-24 21:32:19 $
+ *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-02-13 03:14:42 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -292,5 +292,10 @@
         // find the peak in this image
         stats = psStatsAlloc (PS_STAT_MAX);
-        stats = psImageStats (stats, splane, NULL, 0);
+        if (!psImageStats (stats, splane, NULL, 0)) {
+            psError(PS_ERR_UNKNOWN, false, "Unable to get image statistics.\n");
+            psFree(stats);
+            psFree(splane);
+            return emptyClump;
+        }
         peaks = pmFindImagePeaks (splane, stats[0].max / 2);
         psTrace ("psModules.objects", 2, "clump threshold is %f\n", stats[0].max/2);
@@ -544,5 +549,5 @@
 pmSource data structure, along with the peak location, and determines the
 various moments associated with that peak.
- 
+
 Requires the following to have been created:
     pmSource
@@ -551,7 +556,7 @@
     pmSource->weight
     pmSource->mask
- 
+
 XXX: The peak calculations are done in image coords, not subImage coords.
- 
+
 XXX EAM : this version clips input pixels on S/N
 XXX EAM : this version returns false for several reasons
