--- ray/src/rt/srcobstr.c 2007/10/08 18:07:57 2.14 +++ ray/src/rt/srcobstr.c 2013/08/07 05:10:09 2.17 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: srcobstr.c,v 2.14 2007/10/08 18:07:57 greg Exp $"; +static const char RCSid[] = "$Id: srcobstr.c,v 2.17 2013/08/07 05:10:09 greg Exp $"; #endif /* * Source occlusion caching routines @@ -63,7 +63,7 @@ initobscache(int sn) FVECT rorg, rdir; RREAL d; int i, j, k; - int ax, ax1, ax2; + int ax=0, ax1=1, ax2=2; if (srcp->sflags & (SSKIP|SPROX|SSPOT|SVIRTUAL)) return; /* don't cache these */ @@ -180,7 +180,7 @@ initobscache(int sn) static OBJECT * /* return occluder cache entry */ srcobstructp(register RAY *r) { - static unsigned long lastrno = ~0; + static RNUMBER lastrno = ~0; static OBJECT noobs; static OBJECT *lastobjp; SRCREC *srcp; @@ -200,7 +200,7 @@ srcobstructp(register RAY *r) initobscache(r->rsrc); /* compute cache index */ if (srcp->sflags & SDISTANT) { - int ax, ax1, ax2; + int ax=0, ax1=1, ax2=2; double t; ax = srcp->obscache->p.d.ax; if ((ax1 = ax+1) >= 3) ax1 -= 3; @@ -335,6 +335,12 @@ markclip(OBJREC *m) { OBJECT *set2add, *oldset; + if (m == NULL) { /* starting over */ + if (antimodlist != NULL) + free((void *)antimodlist); + antimodlist = NULL; + return; + } m_clip(m, NULL); /* initialize modifier list */ if ((set2add = (OBJECT *)m->os) == NULL || !set2add[0]) return;