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

Comparing ray/src/util/cmatrix.c (file contents):
Revision 2.28 by greg, Mon Mar 30 20:41:47 2020 UTC vs.
Revision 2.29 by greg, Fri Jan 15 02:46:28 2021 UTC

# Line 33 | Line 33 | cm_alloc(int nrows, int ncols)
33          if ((nrows <= 0) | (ncols <= 0))
34                  error(USER, "attempt to create empty matrix");
35          cm = (CMATRIX *)malloc(sizeof(CMATRIX) +
36 <                                sizeof(COLOR)*(nrows*ncols - 1));
36 >                                sizeof(COLOR)*((size_t)nrows*ncols - 1));
37          if (!cm)
38                  error(SYSTEM, "out of memory in cm_alloc()");
39          cm->nrows = nrows;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines