Commit 7f4fa041 authored by Filip Roséen's avatar Filip Roséen Committed by Thomas Guillem

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's avatarSteve Lhomme <robux4@videolabs.io>
Signed-off-by: Thomas Guillem's avatarThomas Guillem <thomas@gllm.fr>
parent eca9932c
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment