EbmlMaster: don't try to get end position of an element with an unknown size

See https://trac.bunkus.org/ticket/1089
This commit is contained in:
Moritz Bunkus 2014-12-18 23:33:18 +01:00
parent ef3f1430dd
commit ea8ea4ca99

View File

@ -422,7 +422,7 @@ void EbmlMaster::Read(EbmlStream & inDataStream, const EbmlSemanticContext & sCo
inDataStream.I_O().setFilePointer(GetSizePosition() + GetSizeLength(), seek_beginning);
ElementLevelA = inDataStream.FindNextElement(sContext, UpperEltFound, MaxSizeToRead, AllowDummyElt);
while (ElementLevelA != NULL && UpperEltFound <= 0 && MaxSizeToRead > 0) {
if (IsFiniteSize())
if (IsFiniteSize() && ElementLevelA->IsFiniteSize())
MaxSizeToRead = GetEndPosition() - ElementLevelA->GetEndPosition(); // even if it's the default value
if (!AllowDummyElt && ElementLevelA->IsDummy()) {
ElementLevelA->SkipData(inDataStream, sContext);