Browse Source

demux/mkv: fix 17572: error on cluster without timecode

As can be read in the MKV specification, a cluster must include a
timecode element in order to be valid.

These changes make sure that we error if such element is missing,
effectivelly preventing us from calling KaxCluster::GlobalTimecode
(which will assert if KaxCluster::InitTimecode has not been called).

fixes #17572

Signed-off-by: Steve Lhomme <robux4@videolabs.io>
Signed-off-by: Thomas Guillem <thomas@gllm.fr>
pull/50/head
Filip Roséen 10 years ago
committed by Thomas Guillem
parent
commit
7f4fa0414e
  1. 9
      modules/demux/mkv/matroska_segment_parse.cpp

9
modules/demux/mkv/matroska_segment_parse.cpp

@ -1228,16 +1228,25 @@ bool matroska_segment_c::ParseCluster( KaxCluster *cluster, bool b_update_start_
return false;
}
bool b_has_timecode = false;
for( unsigned int i = 0; i < cluster->ListSize(); ++i )
{
if( MKV_CHECKED_PTR_DECL( p_ctc, KaxClusterTimecode, (*cluster)[i] ) )
{
cluster->InitTimecode( static_cast<uint64>( *p_ctc ), i_timescale );
_seeker.add_cluster( cluster );
b_has_timecode = true;
break;
}
}
if( !b_has_timecode )
{
msg_Err( &sys.demuxer, "Detected cluster without mandatory timecode" );
return false;
}
if( b_update_start_time )
i_mk_start_time = cluster->GlobalTimecode() / INT64_C( 1000 );

Loading…
Cancel
Save