Index: trunk/ppImage/src/ppImageDetrendReadout.c
===================================================================
--- trunk/ppImage/src/ppImageDetrendReadout.c	(revision 42964)
+++ trunk/ppImage/src/ppImageDetrendReadout.c	(revision 43038)
@@ -167,4 +167,13 @@
     }
 
+    // Mask bad cells based on the overscan values
+    if (options->doMaskBadOverscan) {
+      if (!ppImageMaskBadOverscan(input, config)) {
+	psError(PS_ERR_UNKNOWN, false, "Unable to mask readout based on overscan");
+	psFree(detview);
+	return(false);
+      }
+    }
+
     // measure the overscan-subtracted readoutBackground here (or subtract the overscan value?)
     // XXX this is the measurements and should be independent of the pattern masking
