summaryrefslogtreecommitdiff
path: root/src/lib/openjpip/jpipstream_manager.c
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2012-10-08 15:59:17 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2012-10-08 15:59:17 +0000
commit9832c911b36f25f228e391c6da876f79b664af0e (patch)
tree076c1fb815e638ca8ac4d6f287865e9c8e547b21 /src/lib/openjpip/jpipstream_manager.c
parent23f5eeec20e853c5534df735d9263befda9b0135 (diff)
[trunk] Update JPIP (FolderReorgProposal task)
This commit does three things: - Use opj_malloc/calloc/free instead of the default C ones. - Update JPIP API to start using cio _v2 API - Create a new opj_jpip_compress which is the replacement for image_to_j2k -jpip Update issue 177
Diffstat (limited to 'src/lib/openjpip/jpipstream_manager.c')
-rw-r--r--src/lib/openjpip/jpipstream_manager.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/openjpip/jpipstream_manager.c b/src/lib/openjpip/jpipstream_manager.c
index 8cb2a77f..3227af75 100644
--- a/src/lib/openjpip/jpipstream_manager.c
+++ b/src/lib/openjpip/jpipstream_manager.c
@@ -40,14 +40,14 @@
Byte_t * update_JPIPstream( Byte_t *newstream, OPJ_SIZE_T newstreamlen, Byte_t *cache_stream, OPJ_SIZE_T *streamlen)
{
- Byte_t *stream = (Byte_t *)malloc( (*streamlen)+newstreamlen);
+ Byte_t *stream = (Byte_t *)opj_malloc( (*streamlen)+newstreamlen);
if( *streamlen > 0)
memcpy( stream, cache_stream, *streamlen);
memcpy( stream+(*streamlen), newstream, newstreamlen);
*streamlen += newstreamlen;
if(cache_stream)
- free( cache_stream);
+ opj_free( cache_stream);
return stream;
}
@@ -83,7 +83,7 @@ Byte_t * jpipstream_to_pnm( Byte_t *jpipstream, msgqueue_param_t *msgqueue, Byte
fp = fopen( j2kfname, "w+b");
fwrite( j2kstream, j2klen, 1, fp);
- free( j2kstream);
+ opj_free( j2kstream);
fseek( fp, 0, SEEK_SET);
pnmstream = j2k_to_pnm( fp, ihdrbox);
@@ -103,18 +103,18 @@ ihdrbox_param_t * get_SIZ_from_jpipstream( Byte_t *jpipstream, msgqueue_param_t
j2kstream = recons_j2kmainhead( msgqueue, jpipstream, csn, &j2klen);
if( !get_mainheader_from_j2kstream( j2kstream, &SIZ, NULL)){
- free( j2kstream);
+ opj_free( j2kstream);
return NULL;
}
- ihdrbox = (ihdrbox_param_t *)malloc( sizeof(ihdrbox_param_t));
+ ihdrbox = (ihdrbox_param_t *)opj_malloc( sizeof(ihdrbox_param_t));
ihdrbox->width = SIZ.Xsiz;
ihdrbox->height = SIZ.Ysiz;
ihdrbox->nc = SIZ.Csiz;
ihdrbox->bpc = SIZ.Ssiz[0];
- free( j2kstream);
+ opj_free( j2kstream);
return ihdrbox;
}