--- ray/src/common/interp2d.c 2013/02/12 17:47:58 2.7 +++ ray/src/common/interp2d.c 2013/02/12 18:41:39 2.9 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: interp2d.c,v 2.7 2013/02/12 17:47:58 greg Exp $"; +static const char RCSid[] = "$Id: interp2d.c,v 2.9 2013/02/12 18:41:39 greg Exp $"; #endif /* * General interpolation method for unstructured values on 2-D plane. @@ -71,7 +71,7 @@ interp2_realloc(INTERP2 *ip, int nsamps) interp2_free(ip); return(NULL); } - if (nsamps == ip->ns); + if (nsamps == ip->ns) return(ip); if (ip->da != NULL) { /* will need to recompute distribution */ free(ip->da); @@ -303,6 +303,8 @@ interp2_topsamp(float wt[], int si[], const int n, INT /* identify top n weights */ for (i = ip->ns; i--; ) { const double wti = get_wt(ip, i, x, y); + if (wti <= 1e-9) + continue; for (j = nn; j > 0; j--) { if (wt[j-1] >= wti) break;