diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-05-21 11:24:29 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-05-21 15:42:51 +0200 |
| commit | 272b3e0fb2530ca8bffdc8c64f1505a8ff5f6ecc (patch) | |
| tree | 04ed7fbccf21bc452f55de29bb9ad8c46783e020 | |
| parent | 47943daa15983d20ab1ffd0a237125f1493c5658 (diff) | |
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 dbeebe72b9d35f6ff807c21c7f217b569fa894f6
where vector 9x7 decoding was introduced.
| -rw-r--r-- | src/lib/openjp2/dwt.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/src/lib/openjp2/dwt.c b/src/lib/openjp2/dwt.c index 9fef2234..84d5aaf5 100644 --- a/src/lib/openjp2/dwt.c +++ b/src/lib/openjp2/dwt.c @@ -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); |
