And fix the crash of http://streams.videolan.org/issues/mkv/invalid_EBML_number_size_tag.mkv
Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
p_current_segment = p_new_segment;
i_current_title = p_new_segment->i_sys_title;
}
+ if( !p_current_segment->CurrentSegment() )
+ return false;
if( !p_current_segment->CurrentSegment()->b_cues )
msg_Warn( &p_current_segment->CurrentSegment()->sys.demuxer, "no cues/empty cues found->seek won't be precise" );
{
for( size_t i = 0; i < chapters.size(); i++ )
{
- if( time >= chapters[i]->i_virtual_start_time && time < chapters[i]->i_virtual_stop_time )
+ if( time >= chapters[i]->i_virtual_start_time &&
+ ( chapters[i]->i_virtual_stop_time < 0 || time < chapters[i]->i_virtual_stop_time ) )
+ /*with the current implementation only the last chapter can have a negative virtual_stop_time*/
return chapters[i]->getSubChapterbyTimecode( time );
}