# | 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; |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |