Merge pull request #617 from mayeut/tpsot-tnsot-noseek

Add check for seek support before trying TPsot==TNsot workaround
This commit is contained in:
Matthieu Darbois 2015-10-05 11:45:56 +02:00
commit 83c9e0b1f2
1 changed files with 5 additions and 0 deletions

View File

@ -7682,6 +7682,11 @@ static OPJ_BOOL opj_j2k_need_nb_tile_parts_correction(opj_stream_private_t *p_st
/* initialize to no correction needed */ /* initialize to no correction needed */
*p_correction_needed = OPJ_FALSE; *p_correction_needed = OPJ_FALSE;
if (!opj_stream_has_seek(p_stream)) {
/* We can't do much in this case, seek is needed */
return OPJ_TRUE;
}
l_stream_pos_backup = opj_stream_tell(p_stream); l_stream_pos_backup = opj_stream_tell(p_stream);
if (l_stream_pos_backup == -1) { if (l_stream_pos_backup == -1) {
/* let's do nothing */ /* let's do nothing */