ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/vwrays.c
(Generate patch)

Comparing ray/src/util/vwrays.c (file contents):
Revision 3.18 by greg, Thu Aug 18 00:52:48 2016 UTC vs.
Revision 3.20 by greg, Thu Nov 7 23:20:29 2019 UTC

# Line 134 | Line 134 | main(
134                          exit(1);
135                  }
136                  if (i+1 < argc) {
137 <                        zfd = open(argv[i+1], O_RDONLY);
138 <                        if (zfd < 0) {
139 <                                fprintf(stderr,
140 <                                        "%s: cannot open depth buffer\n",
141 <                                                argv[i+1]);
137 >                        zfd = open_float_depth(argv[i+1], (long)rs.xr*rs.yr);
138 >                        if (zfd < 0)
139                                  exit(1);
143                        }
140                  }
141          }
142          if ((err = setview(&vw)) != NULL) {
# Line 196 | Line 192 | pix2rays(
192                  px += .5; py += .5;
193                  loc[0] = px/rs.xr; loc[1] = py/rs.yr;
194                  if (zfd >= 0) {
195 +                        if ((loc[0] < 0) | (loc[0] >= 1) |
196 +                                        (loc[1] < 0) | (loc[1] >= 1)) {
197 +                                fprintf(stderr, "%s: input pixel outside image\n",
198 +                                                progname);
199 +                                exit(1);
200 +                        }
201                          loc2pix(pp, &rs, loc[0], loc[1]);
202                          if (lseek(zfd,
203                                  (pp[1]*scanlen(&rs)+pp[0])*sizeof(float),

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines