Index: trunk/psModules/src/pmReadoutCombine.c
===================================================================
--- trunk/psModules/src/pmReadoutCombine.c	(revision 2832)
+++ trunk/psModules/src/pmReadoutCombine.c	(revision 2857)
@@ -5,6 +5,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.17 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-12-27 23:16:51 $
+ *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-12-30 22:22:00 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -82,5 +82,5 @@
     if (1 < DetermineNumBits(params->stats->options)) {
         psError(PS_ERR_UNKNOWN, true,
-                "Multiple statistical options have been requested.\n");
+                "Multiple statistical options have been requested.  Returning NULL.\n");
         return(NULL);
     }
@@ -128,5 +128,5 @@
         PS_VECTOR_CHECK_TYPE(zero, PS_TYPE_F32, NULL);
         if (numInputs > zero->n) {
-            psError(PS_ERR_UNKNOWN, true, "zero vector has incorrect size (%d)\n", zero->n);
+            psError(PS_ERR_UNKNOWN, true, "zero vector has incorrect size (%d).  Returning NULL.\n", zero->n);
             return(NULL);
         } else if (numInputs < zero->n) {
@@ -140,5 +140,5 @@
         PS_VECTOR_CHECK_TYPE(scale, PS_TYPE_F32, NULL);
         if (numInputs > scale->n) {
-            psError(PS_ERR_UNKNOWN, true, "scale vector has incorrect size (%d)\n", scale->n);
+            psError(PS_ERR_UNKNOWN, true, "scale vector has incorrect size (%d).  Returning NULL.\n", scale->n);
             return(NULL);
         } else if (numInputs < scale->n) {
@@ -163,5 +163,5 @@
                 ((output->row0 + output->numRows) < maxInputRows)) {
             psError(PS_ERR_UNKNOWN, true,
-                    "Output image (%d, %d) is too small to hold combined images.\n",
+                    "Output image (%d, %d) is too small to hold combined images.  Returning NULL.\n",
                     output->row0 + output->numRows,
                     output->col0 + output->numCols);
@@ -171,5 +171,5 @@
         if ((output->col0 > minInputCols) || (output->row0 > minInputRows)) {
             psError(PS_ERR_UNKNOWN, true,
-                    "Output image offset is larger then input image offset.\n");
+                    "Output image offset is larger then input image offset.  Returning NULL.\n");
             return(NULL);
         }
@@ -313,9 +313,13 @@
                 }
                 // Calculate the specified statistic on the stack of pixels.
-                stats = psVectorStats(stats,
-                                      tmpPixels,
-                                      tmpPixelErrors,
-                                      tmpPixelMaskNKeep,
-                                      1);
+                psStats *rc = psVectorStats(stats,
+                                            tmpPixels,
+                                            tmpPixelErrors,
+                                            tmpPixelMaskNKeep,
+                                            1);
+                if (rc == NULL) {
+                    psError(PS_ERR_UNKNOWN, false, "psVectorStats(): could not perform requested statistical operation.  Returning NULL.\n");
+                    return(NULL);
+                }
             } else {
                 if (scale != NULL) {
@@ -333,9 +337,13 @@
 
                 // Calculate the specified statistic on the stack of pixels.
-                stats = psVectorStats(stats,
-                                      tmpPixels,
-                                      NULL,
-                                      tmpPixelMaskNKeep,
-                                      1);
+                psStats *rc = psVectorStats(stats,
+                                            tmpPixels,
+                                            NULL,
+                                            tmpPixelMaskNKeep,
+                                            1);
+                if (rc == NULL) {
+                    psError(PS_ERR_UNKNOWN, false, "psVectorStats(): could not perform requested statistical operation.  Returning NULL.\n");
+                    return(NULL);
+                }
             }
 
@@ -344,5 +352,5 @@
             double statValue;
             if (!p_psGetStatValue(stats, &statValue)) {
-                psError(PS_ERR_UNKNOWN, true, "Could not determine stats value.\n");
+                psError(PS_ERR_UNKNOWN, true, "Could not determine stats value.  Returning NULL.\n");
                 return(NULL);
             } else {
