--- ray/src/common/bsdf.c 2011/07/07 15:25:09 2.34 +++ ray/src/common/bsdf.c 2011/09/17 22:09:33 2.36 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: bsdf.c,v 2.34 2011/07/07 15:25:09 greg Exp $"; +static const char RCSid[] = "$Id: bsdf.c,v 2.36 2011/09/17 22:09:33 greg Exp $"; #endif /* * bsdf.c @@ -171,8 +171,10 @@ SDloadFile(SDData *sd, const char *fname) } /* load geometry if present */ lastErr = SDloadGeometry(sd, ezxml_child(wtl, "Material")); - if (lastErr) + if (lastErr) { + ezxml_free(fl); return lastErr; + } /* try loading variable resolution data */ lastErr = SDloadTre(sd, wtl); /* check our result */ @@ -423,7 +425,7 @@ SDsampComponent(SDValue *sv, FVECT ioVec, double randX cd = (*sdc->func->getCDist)(inVec, sdc); if (cd == NULL) return SDEmemory; - if (cd->cTotal <= 1e-7) { /* anything to sample? */ + if (cd->cTotal <= 1e-6) { /* anything to sample? */ sv->spec = c_dfcolor; sv->cieY = .0; memset(ioVec, 0, 3*sizeof(double)); @@ -685,7 +687,7 @@ SDsampBSDF(SDValue *sv, FVECT ioVec, double randX, int } sv->cieY += cdarr[i]->cTotal; } - if (sv->cieY <= 1e-7) { /* anything to sample? */ + if (sv->cieY <= 1e-6) { /* anything to sample? */ sv->cieY = .0; memset(ioVec, 0, 3*sizeof(double)); return SDEnone;