Index: trunk/psphot/src/psphotExtendedSourceFits.c
===================================================================
--- trunk/psphot/src/psphotExtendedSourceFits.c	(revision 17396)
+++ trunk/psphot/src/psphotExtendedSourceFits.c	(revision 18555)
@@ -15,4 +15,10 @@
     psMaskType maskVal = psMetadataLookupU8(&status, recipe, "MASK.PSPHOT"); // Mask value for bad pixels
     assert (maskVal);
+
+    psMaskType markVal = psMetadataLookupU8(&status, recipe, "MARK.PSPHOT"); // Mask value for bad pixels
+    assert (markVal);
+
+    // maskVal is used to test for rejected pixels, and must include markVal
+    maskVal |= markVal;
 
     // perform full extended source non-linear fits?
@@ -155,5 +161,5 @@
 	  pmModel *modelFit = NULL;
 	  if (convolved) {
-	      modelFit = psphotPSFConvModel (readout, source, modelType, maskVal, psfSize);
+	      modelFit = psphotPSFConvModel (readout, source, modelType, maskVal, markVal, psfSize);
 	      if (!modelFit) {
 		  psTrace ("psphot", 5, "failed to fit psf-conv model for object at %f, %f", source->moments->x, source->moments->y);
@@ -168,5 +174,5 @@
 	      psFree (source->modelFlux);
 	      source->modelFlux = NULL;
-	      modelFit = psphotFitEXT (readout, source, modelType, maskVal);
+	      modelFit = psphotFitEXT (readout, source, modelType, maskVal, markVal);
 	      if (!modelFit) {
 		  psTrace ("psphot", 5, "failed to fit plain model for object at %f, %f", source->moments->x, source->moments->y);
