Index: trunk/psLib/src/math/psStats.c
===================================================================
--- trunk/psLib/src/math/psStats.c	(revision 12999)
+++ trunk/psLib/src/math/psStats.c	(revision 13418)
@@ -13,6 +13,6 @@
  * use ->min and ->max (PS_STAT_USE_RANGE)
  *
- *  @version $Revision: 1.209 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-04-24 22:27:44 $
+ *  @version $Revision: 1.210 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-05-18 13:19:55 $
  *
  *  Copyright 2006 IfA, University of Hawaii
@@ -259,4 +259,10 @@
     for (long i = 0; i < num; i++) {
         // Check if the data is with the specified range
+	if (!isfinite(vector[i])) {
+	    stats->max = stats->min = NAN;
+	    psError(PS_ERR_IEEE, true, "Element %ld of vector is Inf/NaN", i);
+	    return 0;
+	}
+	
         if (useRange && (vector[i] < stats->min))
             continue;
