if(image->numcomps > 2)/* RGB, RGBA */
{
unsigned short *inbuf, *outbuf, *in, *out;
- max = max_w * max_h; nr_samples = max * 3 * sizeof(unsigned short);
+ max = max_w * max_h;
+ nr_samples = (cmsUInt32Number)(max * 3 * sizeof(unsigned short));
in = inbuf = (unsigned short*)malloc(nr_samples);
out = outbuf = (unsigned short*)malloc(nr_samples);
const char *s, *magic_s;
int ext_format, magic_format;
unsigned char buf[12];
- unsigned int l_nb_read;
+ OPJ_SIZE_T l_nb_read;
reader = fopen(fname, "rb");
rw = l_cur_res->x1 - l_cur_res->x0;
rh = l_cur_res->y1 - l_cur_res->y0;
- l_data_size = opj_dwt_max_resolution( tilec->resolutions,tilec->numresolutions) * sizeof(OPJ_INT32);
+ l_data_size = opj_dwt_max_resolution( tilec->resolutions,tilec->numresolutions) * (OPJ_UINT32)sizeof(OPJ_INT32);
bj = (OPJ_INT32*)opj_malloc(l_data_size);
if (! bj) {
return OPJ_FALSE;