diff options
| author | Matthieu Darbois <mayeut@users.noreply.github.com> | 2016-09-15 01:57:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-15 01:57:53 +0200 |
| commit | 9a07ccb3d0f076388e4da684a3bfd4327125c721 (patch) | |
| tree | 6d1567ca026d9020c2a44e35a6268a0a689b958a /src/lib/openjp2/pi.c | |
| parent | f88c9974e27161427c003dda5d89f61a5a3995e9 (diff) | |
Add overflow checks for opj_aligned_malloc (#841)
See
https://pdfium.googlesource.com/pdfium/+/b20ab6c7acb3be1393461eb650ca8fa4660c937e/third_party/libopenjpeg20/0020-opj_aligned_malloc.patch
Diffstat (limited to 'src/lib/openjp2/pi.c')
| -rw-r--r-- | src/lib/openjp2/pi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/openjp2/pi.c b/src/lib/openjp2/pi.c index 809b33d7..41a2f046 100644 --- a/src/lib/openjp2/pi.c +++ b/src/lib/openjp2/pi.c @@ -1238,14 +1238,14 @@ opj_pi_iterator_t *opj_pi_create_decode(opj_image_t *p_image, /* memory allocation for include */ /* prevent an integer overflow issue */ + /* 0 < l_tcp->numlayers < 65536 c.f. opj_j2k_read_cod in j2k.c */ l_current_pi->include = 00; if (l_step_l <= (SIZE_MAX / (l_tcp->numlayers + 1U))) { l_current_pi->include = (OPJ_INT16*) opj_calloc((size_t)(l_tcp->numlayers + 1U) * l_step_l, sizeof(OPJ_INT16)); } - if - (!l_current_pi->include) + if (!l_current_pi->include) { opj_free(l_tmp_data); opj_free(l_tmp_ptr); |
