[trunk] begin to clean the old V1 style message event management
[openjpeg.git] / libopenjpeg / thix_manager.c
old mode 100755 (executable)
new mode 100644 (file)
index bdedc30..3805488
  *  \brief Modification of jpip.c from 2KAN indexer
  */
 
-#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 +53,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 +75,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;
 }
@@ -111,7 +107,7 @@ int write_tilemhix( int coff, opj_codestream_info_t cstr_info, int tileno, opj_c
     cio_write( cio, marker[i].len, 2);
   }
      
-  //  free( marker);
+  /*  free( marker);*/
 
   len = cio_tell( cio) - lenp;
   cio_seek( cio, lenp);