if (partno >= tile->Cztile_parts)
{
tilepart_tmp = (info_tile_part_t*)malloc((INCREMENT + tile->Cztile_parts) * sizeof(info_tile_part_t));
- memcpy(tmp, tile->tile_parts, tile->Cztile_parts);
+ memcpy(tilepart_tmp, tile->tile_parts, tile->Cztile_parts);
tile->Cztile_parts += INCREMENT;
free(tile->tile_parts);
tile->tile_parts = tilepart_tmp;
int j2k_index_JPIP(char *Idx_file, char *J2K_file, int len, int version){
FILE *dest;
- char *index;
+ unsigned char *index;
int pos_iptr, end_pos;
int len_cidx, pos_cidx;
int len_jp2c, pos_jp2c;
}
/* INDEX MODE JPIP */
- index = (char*)malloc(len);
+ index = (unsigned char*)malloc(len);
cio_init(index, len);
jp2_write_jp();
jp2_write_ftyp();
}
-#ifdef WIN32
+#ifdef _WIN32
#include <windows.h>
BOOL APIENTRY DllMain(HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
}
return TRUE;
}
-#endif
+#endif /* _WIN32 */
int main(int argc, char **argv)
{
FILE *src;
int totlen;
- char *j2kfile;
+ unsigned char *j2kfile;
j2k_image_t *imgg;
j2k_cp_t *cp;
int version;
if (argc != 4)
{
- fprintf(stderr,"\nERROR in entry : index_create J2K-file Idx-file version\n\nVersion : 0, 1, 2 or 3\n\n");
+ fprintf(stderr,"\nUSAGE : ./index_create J2K-file JP2-file version\n\nVersion : 0, 1, 2 or 3\n 0 : [faix] 4-byte and no AUX fields\n 1 : [faix] 8-byte and no AUX fields\n 2 : [faix] 4-byte and AUX fields\n 3 : [faix] 8-byte and AUX fields\n\nReference Document : annex I from JPIP-FCD-version 2 (SC 29 N5727)\n\n");
return 1;
}
totlen = ftell(src);
fseek(src, 0, SEEK_SET);
- j2kfile = (char*)malloc(totlen);
+ j2kfile = (unsigned char*)malloc(totlen);
fread(j2kfile, 1, totlen, src);
fclose(src);
if (!j2k_decode(j2kfile, totlen, &imgg, &cp)) {
fprintf(stderr, "Index_creator: failed to decode image!\n");
+ free(j2kfile);
return 1;
}
free(j2kfile);