Commit 289d5a72 authored by Denis Charmet's avatar Denis Charmet Committed by Jean-Baptiste Kempf

Prevents a crash if KaxInfo cannot be found in KaxSegment

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 73160f1a
......@@ -460,7 +460,7 @@ matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlS
{
int i_upper_lvl = 0;
EbmlElement *p_l0, *p_l1, *p_l2;
bool b_keep_stream = false, b_keep_segment;
bool b_keep_stream = false, b_keep_segment = false;
// verify the EBML Header
p_l0 = p_estream->FindNextID(EBML_INFO(EbmlHead), 0xFFFFFFFFL);
......@@ -505,7 +505,6 @@ matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlS
{
EbmlParser *ep;
matroska_segment_c *p_segment1 = new matroska_segment_c( *this, *p_estream );
b_keep_segment = b_initial;
ep = new EbmlParser(p_estream, p_l0, &demuxer );
p_segment1->ep = ep;
......@@ -517,6 +516,7 @@ matroska_stream_c *demux_sys_t::AnalyseAllSegmentsFound( demux_t *p_demux, EbmlS
{
// find the families of this segment
KaxInfo *p_info = static_cast<KaxInfo*>(p_l1);
b_keep_segment = b_initial;
p_info->Read(*p_estream, EBML_CLASS_CONTEXT(KaxInfo), i_upper_lvl, p_l2, true);
for( size_t i = 0; i < p_info->ListSize(); i++ )
......
......@@ -119,7 +119,7 @@ static int Open( vlc_object_t * p_this )
p_stream = p_sys->AnalyseAllSegmentsFound( p_demux, p_io_stream, true );
if( p_stream == NULL )
{
msg_Err( p_demux, "cannot find KaxSegment" );
msg_Err( p_demux, "cannot find KaxSegment or missing mandatory KaxInfo" );
goto error;
}
p_sys->streams.push_back( p_stream );
......
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