diff --git a/src/lib/openjp2/j2k.c b/src/lib/openjp2/j2k.c index a9b42697..466e61b2 100644 --- a/src/lib/openjp2/j2k.c +++ b/src/lib/openjp2/j2k.c @@ -7619,6 +7619,7 @@ OPJ_BOOL opj_j2k_decode_tile ( opj_j2k_t * p_j2k, p_j2k->cstr_index) ) { opj_j2k_tcp_destroy(l_tcp); 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; } @@ -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)) { 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; } 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); diff --git a/src/lib/openjp2/t2.c b/src/lib/openjp2/t2.c index 9cfc0363..dd5f9cc3 100644 --- a/src/lib/openjp2/t2.c +++ b/src/lib/openjp2/t2.c @@ -896,7 +896,7 @@ OPJ_BOOL opj_t2_read_packet_header( opj_t2_t* p_t2, if (p_max_length < 2) { fprintf(stderr, "Not enough space for expected EPH marker\n"); } 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 { l_header_data += 2; } @@ -1224,6 +1224,8 @@ OPJ_BOOL opj_t2_skip_packet_data( opj_t2_t* p_t2, do { 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; }