Index: trunk/psLib/src/astro/psSphereOps.c
===================================================================
--- trunk/psLib/src/astro/psSphereOps.c	(revision 9538)
+++ trunk/psLib/src/astro/psSphereOps.c	(revision 9932)
@@ -8,6 +8,6 @@
  *  @author Dave Robbins, MHPCC
  *
- *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-10-13 21:13:47 $
+ *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-11-09 23:26:04 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -50,4 +50,9 @@
                               double phiP)
 {
+    if (isnan(alphaP) || isnan(deltaP) || isnan(phiP) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "Input angles cannot be NaN in psSphereRotAlloc.");
+        return NULL;
+    }
     psSphereRot *r = sphereRotAlloc();
     psSphereRot *s = sphereRotAlloc();
@@ -95,4 +100,9 @@
                              double q3)
 {
+    if (isnan(q0) || isnan(q1) || isnan(q2) || isnan(q3) ) {
+        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                "Input quaternions cannot be NaN in psSphereRotQuat.");
+        return NULL;
+    }
     //allocate space for a new sphere rotation and set deallocator
     psSphereRot* rot = sphereRotAlloc();
