diff options
| author | Mickael Savinaud <savmickael@users.noreply.github.com> | 2011-09-19 16:53:10 +0000 |
|---|---|---|
| committer | Mickael Savinaud <savmickael@users.noreply.github.com> | 2011-09-19 16:53:10 +0000 |
| commit | af7ebd96a0bcf19d4b5af0eb92f2ac88edc5db55 (patch) | |
| tree | 4f2615ad72d4b08bf442c2ce1d317058ec4e1d29 /libopenjpeg | |
| parent | ac59fd14767291da8cb2905903928da2f8392b21 (diff) | |
Enhance some new JPIP files about opj_config inclusion and using of free/calloc (credit to Julien Malik)
Diffstat (limited to 'libopenjpeg')
| -rwxr-xr-x | libopenjpeg/cidx_manager.c | 8 | ||||
| -rw-r--r-- | libopenjpeg/opj_includes.h | 1 | ||||
| -rwxr-xr-x | libopenjpeg/phix_manager.c | 8 | ||||
| -rwxr-xr-x | libopenjpeg/ppix_manager.c | 7 | ||||
| -rwxr-xr-x | libopenjpeg/thix_manager.c | 7 | ||||
| -rwxr-xr-x | libopenjpeg/tpix_manager.c | 3 |
6 files changed, 15 insertions, 19 deletions
diff --git a/libopenjpeg/cidx_manager.c b/libopenjpeg/cidx_manager.c index c197d543..b2ca1907 100755 --- a/libopenjpeg/cidx_manager.c +++ b/libopenjpeg/cidx_manager.c @@ -31,9 +31,7 @@ #include <stdio.h> #include <stdlib.h> -#include "cidx_manager.h" -#include "indexbox_manager.h" -#include "cio.h" +#include "opj_includes.h" /* @@ -76,7 +74,7 @@ int write_cidx( int offset, opj_cio_t *cio, opj_image_t *image, opj_codestream_i int num_box = 0; opj_bool EPHused; - box = (opj_jp2_box_t *)calloc( 32, sizeof(opj_jp2_box_t)); + box = (opj_jp2_box_t *)opj_calloc( 32, sizeof(opj_jp2_box_t)); for (i=0;i<2;i++){ @@ -120,7 +118,7 @@ int write_cidx( int offset, opj_cio_t *cio, opj_image_t *image, opj_codestream_i cio_seek( cio, lenp+len); } - free( box); + opj_free( box); return len; } diff --git a/libopenjpeg/opj_includes.h b/libopenjpeg/opj_includes.h index b5884dcf..d94237e7 100644 --- a/libopenjpeg/opj_includes.h +++ b/libopenjpeg/opj_includes.h @@ -108,6 +108,7 @@ static INLINE long lrintf(float f){ #include "j2k_lib.h" #include "opj_malloc.h" #include "event.h" +#include "bio.h" #include "cio.h" #include "image.h" diff --git a/libopenjpeg/phix_manager.c b/libopenjpeg/phix_manager.c index 71465ce5..43fa275f 100755 --- a/libopenjpeg/phix_manager.c +++ b/libopenjpeg/phix_manager.c @@ -35,8 +35,8 @@ #include <stdlib.h> #include <math.h> -#include "indexbox_manager.h" -#include "cio.h" +#include "opj_includes.h" + /* * Write faix box of phix @@ -56,7 +56,7 @@ int write_phix( int coff, opj_codestream_info_t cstr_info, opj_bool EPHused, int int len, lenp=0, compno, i; opj_jp2_box_t *box; - box = (opj_jp2_box_t *)calloc( cstr_info.numcomps, sizeof(opj_jp2_box_t)); + box = (opj_jp2_box_t *)opj_calloc( cstr_info.numcomps, sizeof(opj_jp2_box_t)); for( i=0;i<2;i++){ if (i) cio_seek( cio, lenp); @@ -78,7 +78,7 @@ int write_phix( int coff, opj_codestream_info_t cstr_info, opj_bool EPHused, int cio_seek( cio, lenp+len); } - free(box); + opj_free(box); return len; } diff --git a/libopenjpeg/ppix_manager.c b/libopenjpeg/ppix_manager.c index f6ab07e5..f4f67859 100755 --- a/libopenjpeg/ppix_manager.c +++ b/libopenjpeg/ppix_manager.c @@ -36,8 +36,7 @@ #include <stdio.h> #include <stdlib.h> #include <math.h> -#include "indexbox_manager.h" -#include "cio.h" +#include "opj_includes.h" /* * Write faix box of ppix @@ -59,7 +58,7 @@ int write_ppix( int coff, opj_codestream_info_t cstr_info, opj_bool EPHused, int // printf("cstr_info.packno %d\n", cstr_info.packno); //NMAX? - box = (opj_jp2_box_t *)calloc( cstr_info.numcomps, sizeof(opj_jp2_box_t)); + box = (opj_jp2_box_t *)opj_calloc( cstr_info.numcomps, sizeof(opj_jp2_box_t)); for (i=0;i<2;i++){ if (i) cio_seek( cio, lenp); @@ -81,7 +80,7 @@ int write_ppix( int coff, opj_codestream_info_t cstr_info, opj_bool EPHused, int cio_seek( cio, lenp+len); } - free(box); + opj_free(box); return len; } diff --git a/libopenjpeg/thix_manager.c b/libopenjpeg/thix_manager.c index bdedc30c..3dd0be01 100755 --- a/libopenjpeg/thix_manager.c +++ b/libopenjpeg/thix_manager.c @@ -36,8 +36,7 @@ #include <stdlib.h> #include <stdio.h> #include <string.h> -#include "indexbox_manager.h" -#include "cio.h" +#include "opj_includes.h" /* * Write tile-part headers mhix box @@ -57,7 +56,7 @@ int write_thix( int coff, opj_codestream_info_t cstr_info, opj_cio_t *cio) opj_jp2_box_t *box; lenp = 0; - box = (opj_jp2_box_t *)calloc( cstr_info.tw*cstr_info.th, sizeof(opj_jp2_box_t)); + box = (opj_jp2_box_t *)opj_calloc( cstr_info.tw*cstr_info.th, sizeof(opj_jp2_box_t)); for ( i = 0; i < 2 ; i++ ){ if (i) @@ -79,7 +78,7 @@ int write_thix( int coff, opj_codestream_info_t cstr_info, opj_cio_t *cio) cio_seek( cio, lenp+len); } - free(box); + opj_free(box); return len; } diff --git a/libopenjpeg/tpix_manager.c b/libopenjpeg/tpix_manager.c index 1f5c1792..c9133d53 100755 --- a/libopenjpeg/tpix_manager.c +++ b/libopenjpeg/tpix_manager.c @@ -34,8 +34,7 @@ */ #include <math.h> -#include "indexbox_manager.h" -#include "cio.h" +#include "opj_includes.h" #define MAX(a,b) ((a)>(b)?(a):(b)) |
