Index: trunk/psModules/src/imcombine/pmStack.c
===================================================================
--- trunk/psModules/src/imcombine/pmStack.c	(revision 16604)
+++ trunk/psModules/src/imcombine/pmStack.c	(revision 16607)
@@ -8,4 +8,6 @@
  *  @author GLG, MHPCC
  *
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-02-22 19:50:56 $
  *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
  *
@@ -510,4 +512,8 @@
         for (int j = 0; j < pixels->n; j++) {
             int x = pixels->data[j].x, y = pixels->data[j].y; // Coordinates of interest
+            if (x < 0 || x >= numCols || y < 0 || y >= numRows) {
+                psWarning("Bad pixel coordinate: %d,%d --- ignored.", x, y);
+                continue;
+            }
             psArray *columns = map->data[y]; // The columns for that row
             psVector *images = columns->data[x]; // The images for that column
