diff options
| author | Antonin Descampe <antonin@gmail.com> | 2014-09-19 10:26:35 +0000 |
|---|---|---|
| committer | Antonin Descampe <antonin@gmail.com> | 2014-09-19 10:26:35 +0000 |
| commit | 6868ee373ecc69ac472b6d61decc4741723c1540 (patch) | |
| tree | 5fa382777fc9b16d79b4106858b6402d32790f6f /src/lib/openjp2/dwt.c | |
| parent | b9a247b559e62e55f5561624cf4a19aee3c8afdc (diff) | |
added memory allocation checks (fixes issue 355)
Diffstat (limited to 'src/lib/openjp2/dwt.c')
| -rw-r--r-- | src/lib/openjp2/dwt.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/openjp2/dwt.c b/src/lib/openjp2/dwt.c index e1f8a337..bea45742 100644 --- a/src/lib/openjp2/dwt.c +++ b/src/lib/openjp2/dwt.c @@ -571,6 +571,7 @@ OPJ_BOOL opj_dwt_decode_tile(opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres, DWT1D h.mem = (OPJ_INT32*) opj_aligned_malloc(opj_dwt_max_resolution(tr, numres) * sizeof(OPJ_INT32)); if (! h.mem){ + /* FIXME event manager error callback */ return OPJ_FALSE; } @@ -842,6 +843,10 @@ OPJ_BOOL opj_dwt_decode_real(opj_tcd_tilecomp_t* restrict tilec, OPJ_UINT32 numr OPJ_UINT32 w = (OPJ_UINT32)(tilec->x1 - tilec->x0); h.wavelet = (opj_v4_t*) opj_aligned_malloc((opj_dwt_max_resolution(res, numres)+5) * sizeof(opj_v4_t)); + if (!h.wavelet) { + /* FIXME event manager error callback */ + return OPJ_FALSE; + } v.wavelet = h.wavelet; while( --numres) { |
