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

Comparing ray/src/util/rmatrix.c (file contents):
Revision 2.3 by greg, Tue Jul 8 16:39:41 2014 UTC vs.
Revision 2.4 by greg, Thu Jul 24 16:28:17 2014 UTC

# Line 177 | Line 177 | rmx_load(const char *fname)
177                  fclose(fp);
178                  return(NULL);
179          }
180 <        if ((dinfo.dtype == DTrgbe) | (dinfo.dtype == DTxyze)) {
180 >        if ((dinfo.nrows <= 0) | (dinfo.ncols <= 0)) {
181                  if (!fscnresolu(&dinfo.ncols, &dinfo.nrows, fp)) {
182                          fclose(fp);
183                          return(NULL);
184                  }
185 <                dinfo.ncomp = 3;
185 >                if (dinfo.ncomp <= 0)
186 >                        dinfo.ncomp = 3;
187 >                else if ((dinfo.dtype == DTrgbe) | (dinfo.dtype == DTxyze) &&
188 >                                dinfo.ncomp != 3) {
189 >                        fclose(fp);
190 >                        return(NULL);
191 >                }
192          }
193          dnew = rmx_alloc(dinfo.nrows, dinfo.ncols, dinfo.ncomp);
194          if (dnew == NULL) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines