Index: trunk/ppImage/src/ppImageOptions.c
===================================================================
--- trunk/ppImage/src/ppImageOptions.c	(revision 42890)
+++ trunk/ppImage/src/ppImageOptions.c	(revision 43038)
@@ -29,4 +29,5 @@
     options->doNonLin        = false;   // Non-linearity correction
     options->doNewNonLin     = false;   // New Non-linearity correction (v2023)
+    options->doMaskBadOverscan = false; // Mask cells / readouts if overscan is out of bounds
     options->doOverscan      = false;   // Overscan subtraction
     options->doNoiseMap      = false;   // Apply Read Noise Map
@@ -182,4 +183,10 @@
     }
 
+    // Mask cells/readouts with out-of-range overscan 
+    // nominal overscan ranges are loaded from a file defined in the detrend system or on the command-line
+    if (psMetadataLookupBool(NULL, recipe, "MASK.BAD.OVERSCAN")) {
+        options->doMaskBadOverscan = true;
+    }
+
     // XXX PAP: The overscan stuff needs to be updated following the reworked API
 
