fix unchecked integer multiplication overflow
Hello, this fixes an unchecked integer multiplication overflow. Thanks.
This commit is contained in:
parent
da5e897232
commit
24d08ff94a
|
@ -48,8 +48,8 @@ opj_image_t* OPJ_CALLCONV opj_image_create(OPJ_UINT32 numcmpts,
|
||||||
image->color_space = clrspc;
|
image->color_space = clrspc;
|
||||||
image->numcomps = numcmpts;
|
image->numcomps = numcmpts;
|
||||||
/* allocate memory for the per-component information */
|
/* allocate memory for the per-component information */
|
||||||
image->comps = (opj_image_comp_t*)opj_calloc(1,
|
image->comps = (opj_image_comp_t*)opj_calloc(image->numcomps,
|
||||||
image->numcomps * sizeof(opj_image_comp_t));
|
sizeof(opj_image_comp_t));
|
||||||
if (!image->comps) {
|
if (!image->comps) {
|
||||||
/* TODO replace with event manager, breaks API */
|
/* TODO replace with event manager, breaks API */
|
||||||
/* fprintf(stderr,"Unable to allocate memory for image.\n"); */
|
/* fprintf(stderr,"Unable to allocate memory for image.\n"); */
|
||||||
|
|
Loading…
Reference in New Issue