summaryrefslogtreecommitdiff
path: root/src/lib/openjp2/image.c
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2017-07-06 01:47:40 +0200
committerEven Rouault <even.rouault@spatialys.com>2017-08-07 18:32:52 +0200
commitf58aab9d6a57e48bdc60e15dd373c24de74719a9 (patch)
tree8c2153b701957850fc186d5fd74decc61e30220e /src/lib/openjp2/image.c
parent61fb5dd7f81c2e3dfabbb99f59dc89572d59fa37 (diff)
Add opj_image_data_alloc() / opj_image_data_free()
As bin/common/color.c used to directly call malloc()/free(), we need to export functions dedicated to allocating/freeing image component data.
Diffstat (limited to 'src/lib/openjp2/image.c')
-rw-r--r--src/lib/openjp2/image.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/openjp2/image.c b/src/lib/openjp2/image.c
index ecd65ece..e29172b2 100644
--- a/src/lib/openjp2/image.c
+++ b/src/lib/openjp2/image.c
@@ -74,7 +74,7 @@ opj_image_t* OPJ_CALLCONV opj_image_create(OPJ_UINT32 numcmpts,
opj_image_destroy(image);
return NULL;
}
- comp->data = (OPJ_INT32*) opj_aligned_malloc(
+ comp->data = (OPJ_INT32*) opj_image_data_alloc(
(size_t)comp->w * comp->h * sizeof(OPJ_INT32));
if (!comp->data) {
/* TODO replace with event manager, breaks API */
@@ -99,7 +99,7 @@ void OPJ_CALLCONV opj_image_destroy(opj_image_t *image)
for (compno = 0; compno < image->numcomps; compno++) {
opj_image_comp_t *image_comp = &(image->comps[compno]);
if (image_comp->data) {
- opj_aligned_free(image_comp->data);
+ opj_image_data_free(image_comp->data);
}
}
opj_free(image->comps);