Index: trunk/ppStack/src/ppStackThread.c
===================================================================
--- trunk/ppStack/src/ppStackThread.c	(revision 21377)
+++ trunk/ppStack/src/ppStackThread.c	(revision 21477)
@@ -49,5 +49,5 @@
 ppStackThreadData *ppStackThreadDataSetup(const psArray *cells, const psArray *imageNames,
                                           const psArray *maskNames, const psArray *varianceNames,
-                                          const pmConfig *config)
+                                          const psArray *covariances, const pmConfig *config)
 {
     PS_ASSERT_ARRAY_NON_NULL(cells, NULL);
@@ -55,4 +55,5 @@
     PS_ASSERT_ARRAYS_SIZE_EQUAL(cells, maskNames, NULL);
     PS_ASSERT_ARRAYS_SIZE_EQUAL(cells, varianceNames, NULL);
+    PS_ASSERT_ARRAYS_SIZE_EQUAL(cells, covariances, NULL);
 
     ppStackThreadData *stack = psAlloc(sizeof(ppStackThreadData)); // Thread data, to return
@@ -98,5 +99,7 @@
                 continue;
             }
-            readouts->data[j] = pmReadoutAlloc(cell);
+            pmReadout *ro = pmReadoutAlloc(cell); // Readout for thread
+            ro->covariance = psMemIncrRefCounter(covariances->data[j]);
+            readouts->data[j] = ro;
         }
         threads->data[i] = ppStackThreadAlloc(readouts);
@@ -236,5 +239,5 @@
 
     {
-        psThreadTask *task = psThreadTaskAlloc("PPSTACK_INITIAL_COMBINE", 7);
+        psThreadTask *task = psThreadTaskAlloc("PPSTACK_INITIAL_COMBINE", 6);
         task->function = &ppStackReadoutInitialThread;
         psThreadTaskAdd(task);
@@ -250,5 +253,5 @@
 
     {
-        psThreadTask *task = psThreadTaskAlloc("PPSTACK_FINAL_COMBINE", 5);
+        psThreadTask *task = psThreadTaskAlloc("PPSTACK_FINAL_COMBINE", 7);
         task->function = &ppStackReadoutFinalThread;
         psThreadTaskAdd(task);
