opj_t2_encode_packet(): avoid out of bound access of #1297, but likely not the proper fix
This commit is contained in:
parent
18b1138fbe
commit
38d661a389
|
@ -815,6 +815,15 @@ static OPJ_BOOL opj_t2_encode_packet(OPJ_UINT32 tileno,
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Avoid out of bounds access of https://github.com/uclouvain/openjpeg/issues/1297 */
|
||||||
|
/* but likely not a proper fix. */
|
||||||
|
if (precno >= res->pw * res->ph) {
|
||||||
|
opj_event_msg(p_manager, EVT_ERROR,
|
||||||
|
"opj_t2_encode_packet(): accessing precno=%u >= %u\n",
|
||||||
|
precno, res->pw * res->ph);
|
||||||
|
return OPJ_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
prc = &band->precincts[precno];
|
prc = &band->precincts[precno];
|
||||||
l_nb_blocks = prc->cw * prc->ch;
|
l_nb_blocks = prc->cw * prc->ch;
|
||||||
cblk = prc->cblks.enc;
|
cblk = prc->cblks.enc;
|
||||||
|
|
Loading…
Reference in New Issue