--- ray/src/rt/source.c 1990/03/27 11:40:13 1.21 +++ ray/src/rt/source.c 1990/12/13 10:44:04 1.24 @@ -47,10 +47,7 @@ marksources() /* find and mark source objects */ m = objptr(o->omod); - if (m->otype != MAT_LIGHT && - m->otype != MAT_ILLUM && - m->otype != MAT_GLOW && - m->otype != MAT_SPOT) + if (!islight(m->otype)) continue; if (m->oargs.nfargs != (m->otype == MAT_GLOW ? 4 : @@ -310,6 +307,8 @@ char *p; /* data for f */ double prob, ourthresh, hwt, test2, hit2; RAY sr; + if (nsources <= 0) + return; srccnt = (CONTRIB *)malloc(nsources*sizeof(CONTRIB)); cntord = (CNTPTR *)malloc(nsources*sizeof(CNTPTR)); if (srccnt == NULL || cntord == NULL) @@ -408,8 +407,8 @@ char *p; /* data for f */ addcolor(r->rcol, srccnt[cntord[sn].sno].val); } - free(srccnt); - free(cntord); + free((char *)srccnt); + free((char *)cntord); } @@ -457,6 +456,3 @@ register RAY *r; r->rt = r->rot; } } - - -o_source() {} /* intersection with a source is done elsewhere */