Remove useless + 5U margin in opj_dwt_decode_tile_97()

Nothing in code analysis nor test suite shows that this margin is
needed.
It dates back to commit dbeebe72b9
where vector 9x7 decoding was introduced.
This commit is contained in:
Even Rouault 2020-05-21 11:24:29 +02:00
parent 47943daa15
commit 272b3e0fb2
No known key found for this signature in database
GPG Key ID: 33EBBFC47B3DD87D
1 changed files with 4 additions and 13 deletions

View File

@ -2667,13 +2667,11 @@ OPJ_BOOL opj_dwt_decode_tile_97(opj_tcd_tilecomp_t* OPJ_RESTRICT tilec,
OPJ_SIZE_T l_data_size;
l_data_size = opj_dwt_max_resolution(res, numres);
/* overflow check */
if (l_data_size > (SIZE_MAX - 5U)) {
/* FIXME event manager error callback */
return OPJ_FALSE;
if (numres == 1) {
return OPJ_TRUE;
}
l_data_size += 5U;
l_data_size = opj_dwt_max_resolution(res, numres);
/* overflow check */
if (l_data_size > (SIZE_MAX / sizeof(opj_v8_t))) {
/* FIXME event manager error callback */
@ -2836,13 +2834,6 @@ OPJ_BOOL opj_dwt_decode_partial_97(opj_tcd_tilecomp_t* OPJ_RESTRICT tilec,
l_data_size = opj_dwt_max_resolution(tr, numres);
/* overflow check */
if (l_data_size > (SIZE_MAX - 5U)) {
/* FIXME event manager error callback */
opj_sparse_array_int32_free(sa);
return OPJ_FALSE;
}
l_data_size += 5U;
/* overflow check */
if (l_data_size > (SIZE_MAX / sizeof(opj_v8_t))) {
/* FIXME event manager error callback */
opj_sparse_array_int32_free(sa);