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.84 by greg, Sat Mar 22 01:27:22 2025 UTC vs.
Revision 2.85 by greg, Mon Mar 24 18:55:57 2025 UTC

# Line 498 | Line 498 | rmx_write_spec(const rmx_dtype *dp, int nc, int len, F
498          SCOLOR  scol;
499          int     j, k;
500  
501 <        if (nc < 3) return(0);
501 >        if ((nc < 3) | (nc > MAXCSAMP)) return(0);
502          scan = (uby8 *)tempbuffer((nc+1)*len);
503          if (!scan) return(0);
504          for (j = 0; j < len; j++, dp += nc) {
# Line 944 | Line 944 | cm_from_rmatrix(const RMATRIX *rm)
944          int     i, j;
945          CMATRIX *cnew;
946  
947 <        if (!rm || !rm->mtx | (rm->ncomp == 2))
947 >        if (!rm || !rm->mtx | (rm->ncomp == 2) | (rm->ncomp > MAXCSAMP))
948                  return(NULL);
949          cnew = cm_alloc(rm->nrows, rm->ncols);
950          if (!cnew)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines