Commit 90987a33 authored by Steve Lhomme's avatar Steve Lhomme

libebml2: when an element has an invalid size and dummy is allowed, replace it with a dummy

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/foundation_src@836 a6f86f6d-0131-4f8e-9e7b-e335508773d5
parent 6af0312c
......@@ -613,8 +613,17 @@ ebml_element *EBML_FindNextElement(stream *Input, const ebml_parser_context *pCo
if (AllowDummyElt || !EBML_ElementIsDummy(Result)) {
assert(_SizeLength <= 8);
Result->SizeLength = (int8_t)_SizeLength;
Result->DataSize = SizeFound;
if (AllowDummyElt && !EBML_ElementValidateSize(Result) && !EBML_ElementIsDummy(Result))
{
// the element has a good ID but wrong size, so replace with a dummy
NodeDelete((node*)Result);
Result = CreateElement(Input, PossibleIdNSize, PossibleID_Length, &EBML_ContextDummy, NULL);
Result->SizeLength = (int8_t)_SizeLength;
Result->DataSize = SizeFound;
}
// LevelChange values
// -1 : global element
// 0 : child
......
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