Fix an integer overflow issue
Making it more secure to call opj_calloc.
This commit is contained in:
parent
713429b8fa
commit
7f703c696b
|
@ -1240,7 +1240,7 @@ opj_pi_iterator_t *opj_pi_create_decode(opj_image_t *p_image,
|
|||
/* memory allocation for include */
|
||||
/* prevent an integer overflow issue */
|
||||
l_current_pi->include = 00;
|
||||
if (l_step_l && l_tcp->numlayers < UINT_MAX / l_step_l - 1)
|
||||
if (l_step_l && l_tcp->numlayers < UINT_MAX / sizeof(OPJ_INT16) / l_step_l - 1)
|
||||
{
|
||||
l_current_pi->include = (OPJ_INT16*) opj_calloc((l_tcp->numlayers +1) * l_step_l, sizeof(OPJ_INT16));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue