From ea8ea4ca997a97cb1c8069a8fd340b2c1e9596b8 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 18 Dec 2014 23:33:18 +0100 Subject: [PATCH] EbmlMaster: don't try to get end position of an element with an unknown size See https://trac.bunkus.org/ticket/1089 --- src/EbmlMaster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EbmlMaster.cpp b/src/EbmlMaster.cpp index 5735ac9..e06c9ac 100644 --- a/src/EbmlMaster.cpp +++ b/src/EbmlMaster.cpp @@ -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);