/* verify the EBML Header... it shouldn't be bigger than 1kB */
p_l0 = p_stream1->estream.FindNextID(EBML_INFO(EbmlHead), 1024);
- if (p_l0 == NULL)
+ if (p_l0 == nullptr || p_l0->IsDummy())
{
msg_Err( p_demux, "No EBML header found" );
+ delete p_l0;
return false;
}
// find all segments in this file
p_l0 = p_stream1->estream.FindNextID(EBML_INFO(KaxSegment), UINT64_MAX);
- if (p_l0 == NULL)
+ if (p_l0 == nullptr || p_l0->IsDummy())
{
msg_Err( p_demux, "No segment found" );
+ delete p_l0;
return false;
}
- while (p_l0 != 0)
+ while (p_l0 != nullptr)
{
bool b_l0_handled = false;
{
p_l0->SkipData(p_stream1->estream, KaxMatroska_Context);
p_l0 = p_stream1->estream.FindNextID(EBML_INFO(KaxSegment), UINT64_MAX);
+ if (p_l0 != nullptr && p_l0->IsDummy())
+ {
+ delete p_l0;
+ p_l0 = nullptr;
+ }
}
else
{
- p_l0 = NULL;
+ p_l0 = nullptr;
}
if( b_l0_handled == false )
es.I_O().setFilePointer( i_element_position, seek_beginning );
el = es.FindNextID( ClassInfos, 0xFFFFFFFFL);
- if( el == NULL )
+ if( el == nullptr || el->IsDummy() )
{
msg_Err( &sys.demuxer, "cannot load some cues/chapters/tags etc. (broken seekhead or file)" );
es.I_O().setFilePointer( i_sav_position, seek_beginning );
+ delete el;
return false;
}