Skip to content

Commit

Permalink
libebml2: fix reading dummy elements that would otherwise be too big
Browse files Browse the repository at this point in the history
  • Loading branch information
robUx4 committed Aug 22, 2017
1 parent cc32282 commit faaba9b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libebml2/ebmlmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -659,8 +659,9 @@ ebml_element *EBML_FindNextElement(stream *Input, const ebml_parser_context *pCo
{
if (AllowDummyElt)
{
/* add a dummy placeholder for the remaining of the parent */
int LevelChange = 0;
ebml_element *Result = EBML_ElementCreateUsingContext(Input, PossibleIdNSize, PossibleID_Length, Context, &LevelChange, 0, 1);
ebml_element *Result = CreateElement(Input, PossibleIdNSize, PossibleID_Length, &EBML_ContextDummy, NULL);
if (Result != NULL)
{
if (LevelChange > 0)
Expand All @@ -669,6 +670,7 @@ ebml_element *EBML_FindNextElement(stream *Input, const ebml_parser_context *pCo
Result->ElementPosition = Result->SizePosition - PossibleID_Length;
Result->DataSize = 0;
Result->SizeLength = (int8_t)(Context->EndPosition - Result->SizePosition);
Result->EndPosition = Context->EndPosition;
// place the file at the end of the element
Stream_Seek(Input,Context->EndPosition,SEEK_SET);
return Result;
Expand Down

0 comments on commit faaba9b

Please sign in to comment.