diff options
| author | Mickael Savinaud <savmickael@users.noreply.github.com> | 2012-08-16 09:13:58 +0000 |
|---|---|---|
| committer | Mickael Savinaud <savmickael@users.noreply.github.com> | 2012-08-16 09:13:58 +0000 |
| commit | 28a002876243b012369a7408642d867c5c108d6e (patch) | |
| tree | 2cbd849e1a760d0396752c59287df9b5f975c3e1 /libopenjpeg | |
| parent | ec19c32b63875dd4ed1671323ce520d06c5ec6b4 (diff) | |
Correct the wrong output management of opj_stream_read_seek function (thanks to EvenR)
Diffstat (limited to 'libopenjpeg')
| -rw-r--r-- | libopenjpeg/cio.c | 2 | ||||
| -rw-r--r-- | libopenjpeg/cio.h | 2 | ||||
| -rw-r--r-- | libopenjpeg/j2k.c | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/libopenjpeg/cio.c b/libopenjpeg/cio.c index 1e9cdebd..21ef55a9 100644 --- a/libopenjpeg/cio.c +++ b/libopenjpeg/cio.c @@ -880,7 +880,7 @@ OPJ_OFF_T opj_stream_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, op * @param p_stream the stream to skip data from. * @param p_size the number of bytes to skip. * @param p_event_mgr the user event manager to be notified of special events. - * @return the number of bytes skipped, or -1 if an error occured. + * @return OPJ_TRUE if success, or OPJ_FALSE if an error occured. */ opj_bool opj_stream_read_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, opj_event_mgr_t * p_event_mgr) { diff --git a/libopenjpeg/cio.h b/libopenjpeg/cio.h index 1c59e030..f5c4a862 100644 --- a/libopenjpeg/cio.h +++ b/libopenjpeg/cio.h @@ -371,7 +371,7 @@ OPJ_OFF_T opj_stream_read_skip (opj_stream_private_t * p_stream, OPJ_OFF_T p_siz * @param p_stream the stream to skip data from. * @param p_size the number of bytes to skip. * @param p_event_mgr the user event manager to be notified of special events. - * @return the number of bytes skipped, or -1 if an error occured. + * @return OPJ_TRUE if success, or OPJ_FALSE if an error occured. */ opj_bool opj_stream_read_seek (opj_stream_private_t * p_stream, OPJ_OFF_T p_size, struct opj_event_mgr * p_event_mgr); diff --git a/libopenjpeg/j2k.c b/libopenjpeg/j2k.c index 96275325..043a4659 100644 --- a/libopenjpeg/j2k.c +++ b/libopenjpeg/j2k.c @@ -10571,13 +10571,13 @@ static opj_bool opj_j2k_decode_one_tile ( opj_j2k_v2_t *p_j2k, if ( ! p_j2k->cstr_index->tile_index[l_tile_no_to_dec].nb_tps) { /* the index for this tile has not been built, * so move to the last SOT read */ - if ( opj_stream_read_seek(p_stream, p_j2k->m_specific_param.m_decoder.m_last_sot_read_pos+2, p_manager) ){ + if ( !(opj_stream_read_seek(p_stream, p_j2k->m_specific_param.m_decoder.m_last_sot_read_pos+2, p_manager)) ){ opj_event_msg_v2(p_manager, EVT_ERROR, "Problem with seek function\n"); return OPJ_FALSE; } } else{ - if (opj_stream_read_seek(p_stream, p_j2k->cstr_index->tile_index[l_tile_no_to_dec].tp_index[0].start_pos+2, p_manager)) { + if ( !(opj_stream_read_seek(p_stream, p_j2k->cstr_index->tile_index[l_tile_no_to_dec].tp_index[0].start_pos+2, p_manager)) ) { opj_event_msg_v2(p_manager, EVT_ERROR, "Problem with seek function\n"); return OPJ_FALSE; } |
