parent
c02f145cd1
commit
e55d5e29e0
|
@ -468,6 +468,12 @@ static void j2k_read_siz(opj_j2k_t *j2k) {
|
||||||
}
|
}
|
||||||
#endif /* USE_JPWL */
|
#endif /* USE_JPWL */
|
||||||
|
|
||||||
|
/* prevent division by zero */
|
||||||
|
if (!(cp->tdx * cp->tdy)) {
|
||||||
|
opj_event_msg(j2k->cinfo, EVT_ERROR, "JPWL: invalid tile size (tdx: %d, tdy: %d)\n", cp->tdx, cp->tdy);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
image->comps = (opj_image_comp_t*) opj_calloc(image->numcomps, sizeof(opj_image_comp_t));
|
image->comps = (opj_image_comp_t*) opj_calloc(image->numcomps, sizeof(opj_image_comp_t));
|
||||||
for (i = 0; i < image->numcomps; i++) {
|
for (i = 0; i < image->numcomps; i++) {
|
||||||
int tmp, w, h;
|
int tmp, w, h;
|
||||||
|
@ -506,6 +512,12 @@ static void j2k_read_siz(opj_j2k_t *j2k) {
|
||||||
}
|
}
|
||||||
#endif /* USE_JPWL */
|
#endif /* USE_JPWL */
|
||||||
|
|
||||||
|
/* prevent division by zero */
|
||||||
|
if (!(image->comps[i].dx * image->comps[i].dy)) {
|
||||||
|
opj_event_msg(j2k->cinfo, EVT_ERROR, "JPWL: invalid component size (dx: %d, dy: %d)\n", image->comps[i].dx, image->comps[i].dy);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* TODO: unused ? */
|
/* TODO: unused ? */
|
||||||
w = int_ceildiv(image->x1 - image->x0, image->comps[i].dx);
|
w = int_ceildiv(image->x1 - image->x0, image->comps[i].dx);
|
||||||
h = int_ceildiv(image->y1 - image->y0, image->comps[i].dy);
|
h = int_ceildiv(image->y1 - image->y0, image->comps[i].dy);
|
||||||
|
|
Loading…
Reference in New Issue