Index: trunk/psModules/src/imcombine/pmSubtraction.c
===================================================================
--- trunk/psModules/src/imcombine/pmSubtraction.c	(revision 14293)
+++ trunk/psModules/src/imcombine/pmSubtraction.c	(revision 14302)
@@ -4,6 +4,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-07-18 03:43:49 $
+ *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-07-19 00:53:12 $
  *
  *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
@@ -991,6 +991,6 @@
 #endif
 
-            for (int y = j; y < j + fullSize; y++) {
-                for (int x = i; x < i + fullSize; x++) {
+            for (int y = j; y < PS_MIN(j + fullSize, numRows); y++) {
+                for (int x = i; x < PS_MIN(i + fullSize, numCols); x++) {
                     convImage->data.F32[y][x] = background;
 
