Hello, this fixes an unchecked integer multiplication overflow. Thanks.
image->color_space = clrspc;
image->numcomps = numcmpts;
/* allocate memory for the per-component information */
- image->comps = (opj_image_comp_t*)opj_calloc(1,
- image->numcomps * sizeof(opj_image_comp_t));
+ image->comps = (opj_image_comp_t*)opj_calloc(image->numcomps,
+ sizeof(opj_image_comp_t));
if (!image->comps) {
/* TODO replace with event manager, breaks API */
/* fprintf(stderr,"Unable to allocate memory for image.\n"); */