[trunk] Add debug info to track issue 80

Update issue 80
This commit is contained in:
Mathieu Malaterre 2014-03-11 15:17:39 +00:00
parent ddb1d57766
commit db82cf7778
2 changed files with 5 additions and 1 deletions

View File

@ -7619,6 +7619,7 @@ OPJ_BOOL opj_j2k_decode_tile ( opj_j2k_t * p_j2k,
p_j2k->cstr_index) ) { p_j2k->cstr_index) ) {
opj_j2k_tcp_destroy(l_tcp); opj_j2k_tcp_destroy(l_tcp);
p_j2k->m_specific_param.m_decoder.m_state |= 0x8000;/*FIXME J2K_DEC_STATE_ERR;*/ p_j2k->m_specific_param.m_decoder.m_state |= 0x8000;/*FIXME J2K_DEC_STATE_ERR;*/
opj_event_msg(p_manager, EVT_ERROR, "Failed to decode.\n");
return OPJ_FALSE; return OPJ_FALSE;
} }
@ -9120,6 +9121,7 @@ OPJ_BOOL opj_j2k_decode_tiles ( opj_j2k_t *p_j2k,
if (! opj_j2k_decode_tile(p_j2k,l_current_tile_no,l_current_data,l_data_size,p_stream,p_manager)) { if (! opj_j2k_decode_tile(p_j2k,l_current_tile_no,l_current_data,l_data_size,p_stream,p_manager)) {
opj_free(l_current_data); opj_free(l_current_data);
opj_event_msg(p_manager, EVT_ERROR, "Failed to decode tile %d/%d\n", l_current_tile_no +1, p_j2k->m_cp.th * p_j2k->m_cp.tw);
return OPJ_FALSE; return OPJ_FALSE;
} }
opj_event_msg(p_manager, EVT_INFO, "Tile %d/%d has been decoded.\n", l_current_tile_no +1, p_j2k->m_cp.th * p_j2k->m_cp.tw); opj_event_msg(p_manager, EVT_INFO, "Tile %d/%d has been decoded.\n", l_current_tile_no +1, p_j2k->m_cp.th * p_j2k->m_cp.tw);

View File

@ -896,7 +896,7 @@ OPJ_BOOL opj_t2_read_packet_header( opj_t2_t* p_t2,
if (p_max_length < 2) { if (p_max_length < 2) {
fprintf(stderr, "Not enough space for expected EPH marker\n"); fprintf(stderr, "Not enough space for expected EPH marker\n");
} else if ((*l_header_data) != 0xff || (*(l_header_data + 1) != 0x92)) { } else if ((*l_header_data) != 0xff || (*(l_header_data + 1) != 0x92)) {
printf("Error : expected EPH marker\n"); fprintf(stderr, "Error : expected EPH marker\n");
} else { } else {
l_header_data += 2; l_header_data += 2;
} }
@ -1224,6 +1224,8 @@ OPJ_BOOL opj_t2_skip_packet_data( opj_t2_t* p_t2,
do { do {
if (* p_data_read + l_seg->newlen > p_max_length) { if (* p_data_read + l_seg->newlen > p_max_length) {
fprintf(stderr, "segment too long (%d) with max (%d) for codeblock %d (p=%d, b=%d, r=%d, c=%d)\n",
l_seg->newlen, p_max_length, cblkno, p_pi->precno, bandno, p_pi->resno, p_pi->compno);
return OPJ_FALSE; return OPJ_FALSE;
} }