Index: trunk/psLib/src/imageops/psImageInterpolate.c
===================================================================
--- trunk/psLib/src/imageops/psImageInterpolate.c	(revision 20327)
+++ trunk/psLib/src/imageops/psImageInterpolate.c	(revision 20333)
@@ -7,6 +7,6 @@
  *  @author Paul Price, IfA
  *
- *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-10-22 18:40:36 $
+ *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-10-22 22:28:44 $
  *
  *  Copyright 2004-2007 Institute for Astronomy, University of Hawaii
@@ -431,5 +431,11 @@
         *varianceValue = sumVariance / (sumKernel2 - sumBad); \
     } \
-    if (sumBad == 0) { \
+    if (sumKernel == 0.0) { \
+        /* No kernel contributions */ \
+        if (haveMask && maskValue) { \
+            *maskValue |= interp->badMask; \
+        } \
+        status = PS_INTERPOLATE_STATUS_BAD; \
+    } else if (sumBad == 0) { \
         /* Completely good pixel */ \
         status = PS_INTERPOLATE_STATUS_GOOD; \
