- int l_bpcc_size = 8 + jp2->numcomps;
- unsigned char * l_bpcc_data,* l_current_bpcc_ptr;
+ OPJ_INT32 l_bpcc_size = 8 + jp2->numcomps;
+ OPJ_BYTE * l_bpcc_data,* l_current_bpcc_ptr;
- /* TODO MSD */
- /*if (jp2->bpc != 0 ){
- opj_event_msg_v2(p_manager, EVT_WARNING, "A BPCC header box is available although BPC is different to zero (%d)\n",jp2->bpc);
- }*/
+
+ if (jp2->bpc != 255 ){
+ opj_event_msg_v2(p_manager, EVT_WARNING, "A BPCC header box is available although BPC given by the IHDR box (%d) indicate components bit depth is constant\n",jp2->bpc);
+ }
- unsigned int l_colr_size = 11;
- unsigned char * l_colr_data,* l_current_colr_ptr;
+ OPJ_UINT32 l_colr_size = 11;
+ OPJ_BYTE * l_colr_data,* l_current_colr_ptr;
- new_comps[pcol].data = (int*)
- opj_malloc(old_comps[cmp].w * old_comps[cmp].h * sizeof(int));
+ new_comps[pcol].data = (OPJ_INT32*)
+ opj_malloc(old_comps[cmp].w * old_comps[cmp].h * sizeof(OPJ_INT32));
opj_read_bytes(p_pclr_header_data, &l_value , bytes_to_read); /* Cji */
p_pclr_header_data += bytes_to_read;
opj_read_bytes(p_pclr_header_data, &l_value , bytes_to_read); /* Cji */
p_pclr_header_data += bytes_to_read;
/* Part 1, I.5.3.6: 'The shall be at most one Channel Definition box
* inside a JP2 Header box.'*/
/* Part 1, I.5.3.6: 'The shall be at most one Channel Definition box
* inside a JP2 Header box.'*/
opj_event_msg_v2(p_manager, EVT_INFO, "COLR BOX meth value is not a regular value (%d), so we will skip the fields following the approx field.\n", jp2->meth);
jp2->color.jp2_has_colr = 1;
opj_event_msg_v2(p_manager, EVT_INFO, "COLR BOX meth value is not a regular value (%d), so we will skip the fields following the approx field.\n", jp2->meth);
jp2->color.jp2_has_colr = 1;
opj_jp2_img_header_writer_handler_t l_writers [3];
opj_jp2_img_header_writer_handler_t * l_current_writer;
opj_jp2_img_header_writer_handler_t l_writers [3];
opj_jp2_img_header_writer_handler_t * l_current_writer;
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager )
{
opj_stream_private_t *cio,
opj_event_mgr_t * p_manager )
{
- unsigned int i;
- unsigned int l_ftyp_size = 16 + 4 * jp2->numcl;
- unsigned char * l_ftyp_data, * l_current_data_ptr;
+ OPJ_UINT32 i;
+ OPJ_UINT32 l_ftyp_size = 16 + 4 * jp2->numcl;
+ OPJ_BYTE * l_ftyp_data, * l_current_data_ptr;
sign = image->comps[0].sgnd;
jp2->bpc = depth_0 + (sign << 7);
for (i = 1; i < image->numcomps; i++) {
sign = image->comps[0].sgnd;
jp2->bpc = depth_0 + (sign << 7);
for (i = 1; i < image->numcomps; i++) {
const opj_jp2_header_handler_t * l_current_handler;
OPJ_UINT32 l_last_data_size = BOX_SIZE;
OPJ_UINT32 l_current_data_size;
const opj_jp2_header_handler_t * l_current_handler;
OPJ_UINT32 l_last_data_size = BOX_SIZE;
OPJ_UINT32 l_current_data_size;
if (l_current_data == 00) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Not enough memory to handle jpeg2000 file header\n");
if (l_current_data == 00) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Not enough memory to handle jpeg2000 file header\n");
l_last_data_size = l_current_data_size;
}
l_nb_bytes_read = opj_stream_read_data(stream,l_current_data,l_current_data_size,p_manager);
if (l_nb_bytes_read != l_current_data_size) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Problem with reading JPEG2000 box, stream error\n");
l_last_data_size = l_current_data_size;
}
l_nb_bytes_read = opj_stream_read_data(stream,l_current_data,l_current_data_size,p_manager);
if (l_nb_bytes_read != l_current_data_size) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Problem with reading JPEG2000 box, stream error\n");
- /* TODO: LH: why nothing is freed here (as
- all other returns imply a free, even
- in the nominal case)? */
+ opj_free(l_current_data);
if (p_box_max_size < 16) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Cannot handle XL box of less than 16 bytes\n");
if (p_box_max_size < 16) {
opj_event_msg_v2(p_manager, EVT_ERROR, "Cannot handle XL box of less than 16 bytes\n");