opj_tcd_dc_level_shift_decode: avoid int32 overflow when prec == 31. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=2799. Credit to OSS Fuzz

This commit is contained in:
Even Rouault 2017-07-30 15:22:24 +02:00
parent 517bf6fd86
commit 68832af20e
1 changed files with 1 additions and 1 deletions

View File

@ -1883,7 +1883,7 @@ static OPJ_BOOL opj_tcd_dc_level_shift_decode(opj_tcd_t *p_tcd)
l_max = (1 << (l_img_comp->prec - 1)) - 1;
} else {
l_min = 0;
l_max = (1 << l_img_comp->prec) - 1;
l_max = (OPJ_INT32)((1U << l_img_comp->prec) - 1);
}
l_current_ptr = l_tile_comp->data;