Index: /branches/eam_branches/ipp-20101205/psphot/src/psphotExtendedSourceFits.c
===================================================================
--- /branches/eam_branches/ipp-20101205/psphot/src/psphotExtendedSourceFits.c	(revision 30172)
+++ /branches/eam_branches/ipp-20101205/psphot/src/psphotExtendedSourceFits.c	(revision 30173)
@@ -342,9 +342,9 @@
 
         // array to store the pointers to the model flux images while the models are being fitted
-        psArray *modelFluxes = psArrayAllocEmpty (4);
+        psArray *modelFluxes = psArrayAllocEmpty (models->list->n);
 
         // allocate the array to store the model fits
         if (source->modelFits == NULL) {
-            source->modelFits = psArrayAllocEmpty (4);
+            source->modelFits = psArrayAllocEmpty (models->list->n);
         }
 
