Index: trunk/psModules/src/imcombine/pmStack.c
===================================================================
--- trunk/psModules/src/imcombine/pmStack.c	(revision 16419)
+++ trunk/psModules/src/imcombine/pmStack.c	(revision 16420)
@@ -8,6 +8,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-11-10 01:09:20 $
+ *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-02-13 02:55:33 $
  *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
  *
@@ -486,4 +486,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
