Index: trunk/pstamp/src/ppstampMakeStamp.c
===================================================================
--- trunk/pstamp/src/ppstampMakeStamp.c	(revision 35893)
+++ trunk/pstamp/src/ppstampMakeStamp.c	(revision 36060)
@@ -20,4 +20,5 @@
 static bool setMaskedToNAN(pmConfig *config, psImage *image, psImage *mask, psImage *variance);
 static bool copySources(pmReadout *outputReadout, pmReadout *inputReadout, pmReadout *astromReadout, psRegion extractRegion);
+static bool imageHasValidPixels(psImage *image);
 
 // convert the input chip's transforms to the output
@@ -337,4 +338,7 @@
             status = false;
             break;
+        }
+        if (!imageHasValidPixels(outReadout->image)) {
+            return PSTAMP_NO_VALID_PIXELS;
         }
         if (readout->variance) {
@@ -885,2 +889,19 @@
     return true;
 }
+
+static bool
+imageHasValidPixels(psImage *image) {
+    // check F32 image and return true if any pixel is finite
+    if (image->type.type != PS_TYPE_F32) {
+        return true;
+    }
+    for (int y=0; y<image->numRows; y++) {
+        for (int x=0; x<image->numCols; x++) {
+            psF32 pixel = image->data.F32[y][x];
+            if (isfinite(pixel)) {
+                return true;
+            }
+        }
+    }
+    return false;
+}
