--- ray/src/rt/rpict.c 1990/06/26 09:00:12 1.21 +++ ray/src/rt/rpict.c 1990/11/01 12:06:01 1.23 @@ -141,7 +141,8 @@ char *zfile, *oldfile; fputresolu(YMAJOR|YDECR, hresolu, vresolu, stdout); /* recover file and compute first */ i = salvage(oldfile); - if (zfd != -1 && lseek(zfd, (long)i*hresolu*sizeof(float), 0) == -1) + if (zfd != -1 && i > 0 && + lseek(zfd, (long)i*hresolu*sizeof(float), 0) == -1) error(SYSTEM, "z file seek error in render"); ypos = vresolu-1 - i; fillscanline(scanbar[0], zbar[0], hresolu, ypos, psample); @@ -320,8 +321,11 @@ int x, y; /* pixel position */ { static RAY thisray; /* our ray for this pixel */ - viewray(thisray.rorg, thisray.rdir, &ourview, - (x+pixjitter())/hresolu, (y+pixjitter())/vresolu); + if (viewray(thisray.rorg, thisray.rdir, &ourview, + (x+pixjitter())/hresolu, (y+pixjitter())/vresolu) < 0) { + setcolor(col, 0.0, 0.0, 0.0); + return(0.0); + } rayorigin(&thisray, NULL, PRIMARY, 1.0);