summaryrefslogtreecommitdiff
path: root/src/lib/openjp2/dwt.c
diff options
context:
space:
mode:
authorMatthieu Darbois <mayeut@users.noreply.github.com>2015-10-18 03:14:55 +0200
committerMatthieu Darbois <mayeut@users.noreply.github.com>2015-10-18 03:14:55 +0200
commit05b3afd28f8c3f9551d551c565609062f57f5837 (patch)
tree78aa0b5411ce8899ffac8590e29081b3808d9a58 /src/lib/openjp2/dwt.c
parentb1a8e1adcb7e5ac35320dcfab226e5f68eaf81af (diff)
parente1122a8f5081712147a5b36a7b0c9dd81f11c98d (diff)
Merge pull request #636 from uclouvain/opj_malloc-625
Update allocation functions Fix #625 Fix #624 Fix #635
Diffstat (limited to 'src/lib/openjp2/dwt.c')
-rw-r--r--src/lib/openjp2/dwt.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/openjp2/dwt.c b/src/lib/openjp2/dwt.c
index eead5865..92752f42 100644
--- a/src/lib/openjp2/dwt.c
+++ b/src/lib/openjp2/dwt.c
@@ -567,9 +567,11 @@ static OPJ_BOOL opj_dwt_decode_tile(opj_tcd_tilecomp_t* tilec, OPJ_UINT32 numres
OPJ_UINT32 rh = (OPJ_UINT32)(tr->y1 - tr->y0); /* height of the resolution level computed */
OPJ_UINT32 w = (OPJ_UINT32)(tilec->x1 - tilec->x0);
-
- h.mem = (OPJ_INT32*)
- opj_aligned_malloc(opj_dwt_max_resolution(tr, numres) * sizeof(OPJ_INT32));
+
+ if (numres == 1U) {
+ return OPJ_TRUE;
+ }
+ 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;