Fix some division-by-zero problems in src\lib\openjp2\pi.c, including:
https://github.com/uclouvain/openjpeg/issues/731 https://github.com/uclouvain/openjpeg/issues/732 https://github.com/uclouvain/openjpeg/issues/777 https://github.com/uclouvain/openjpeg/issues/778 https://github.com/uclouvain/openjpeg/issues/779 https://github.com/uclouvain/openjpeg/issues/780
This commit is contained in:
parent
da94042481
commit
6c8dd7db78
|
@ -360,9 +360,15 @@ if (!pi->tp_on){
|
||||||
try1 = opj_int_ceildiv(pi->ty1, (OPJ_INT32)(comp->dy << levelno));
|
try1 = opj_int_ceildiv(pi->ty1, (OPJ_INT32)(comp->dy << levelno));
|
||||||
rpx = res->pdx + levelno;
|
rpx = res->pdx + levelno;
|
||||||
rpy = res->pdy + levelno;
|
rpy = res->pdy + levelno;
|
||||||
|
if ((OPJ_INT32)(comp->dy << rpy) == 0 || (1 << rpy) == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!((pi->y % (OPJ_INT32)(comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpy))))){
|
if (!((pi->y % (OPJ_INT32)(comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpy))))){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ((OPJ_INT32)(comp->dx << rpx) == 0 || (1 << rpx) == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!((pi->x % (OPJ_INT32)(comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){
|
if (!((pi->x % (OPJ_INT32)(comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -441,9 +447,15 @@ static OPJ_BOOL opj_pi_next_pcrl(opj_pi_iterator_t * pi) {
|
||||||
try1 = opj_int_ceildiv(pi->ty1, (OPJ_INT32)(comp->dy << levelno));
|
try1 = opj_int_ceildiv(pi->ty1, (OPJ_INT32)(comp->dy << levelno));
|
||||||
rpx = res->pdx + levelno;
|
rpx = res->pdx + levelno;
|
||||||
rpy = res->pdy + levelno;
|
rpy = res->pdy + levelno;
|
||||||
|
if ((OPJ_INT32)(comp->dy << rpy) == 0 || (1 << rpy) == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!((pi->y % (OPJ_INT32)(comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpy))))){
|
if (!((pi->y % (OPJ_INT32)(comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpy))))){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ((OPJ_INT32)(comp->dx << rpx) == 0 || (1 << rpx) == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!((pi->x % (OPJ_INT32)(comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){
|
if (!((pi->x % (OPJ_INT32)(comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -520,9 +532,15 @@ static OPJ_BOOL opj_pi_next_cprl(opj_pi_iterator_t * pi) {
|
||||||
try1 = opj_int_ceildiv(pi->ty1, (OPJ_INT32)(comp->dy << levelno));
|
try1 = opj_int_ceildiv(pi->ty1, (OPJ_INT32)(comp->dy << levelno));
|
||||||
rpx = res->pdx + levelno;
|
rpx = res->pdx + levelno;
|
||||||
rpy = res->pdy + levelno;
|
rpy = res->pdy + levelno;
|
||||||
|
if ((OPJ_INT32)(comp->dy << rpy) == 0 || (1 << rpy) == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!((pi->y % (OPJ_INT32)(comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpy))))){
|
if (!((pi->y % (OPJ_INT32)(comp->dy << rpy) == 0) || ((pi->y == pi->ty0) && ((try0 << levelno) % (1 << rpy))))){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if ((OPJ_INT32)(comp->dx << rpx) == 0 || (1 << rpx) == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!((pi->x % (OPJ_INT32)(comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){
|
if (!((pi->x % (OPJ_INT32)(comp->dx << rpx) == 0) || ((pi->x == pi->tx0) && ((trx0 << levelno) % (1 << rpx))))){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue