[Matroska-devel] clarifications on the use of Unknown Sized Elements

Steve Lhomme slhomme at matroska.org
Thu Jun 11 07:33:27 CEST 2015


On Tue, Jun 9, 2015 at 8:48 AM, Moritz Bunkus <moritz at bunkus.org> wrote:
> Hey,
>
>> - Only Elements that are Master-elements may use an unknown size.
>
> I would be good with this, even though I don't know whether or not we
> had that restriction before.
>
>> - When is the Element of Unknown Size ended. In discussions (in
>>   github, mailing list, and irc) there has been two answers to this:
>>       1. Upon the first occurrence of an Element that is not a valid
>>          sub-element of the unknown-sized element.
>>       2. Upon the first occurrence of an Element that is at the same or a
>>          higher level than the one with an infite size
>
> I was the one who said 2.; basically what I meant was 1. 1. is more
> precise than my wording yesterday (2.), therefore disregard 2., please.
>
> 1. also hints at the problem with elements than can occur at multiple
> levels (EbmlVoid, SimpleTags).
>
>> - Dependency on Schema
>
>> For the SimpleTag option available, the interpretation of the ending
>> of the element presumes that the parse has knowledge of the EBML
>> Schema/Profile of mastroska in any version 1-4. I'd like to include
>> some statement to say that the use of an element of unknown size
>> requires the use of the corresponding schema.
>
> Hmm… going with 1. from before we could indeed have a scenario where an
> element from (a hypothetical version) v5 may include an element from
> earlier versions, e.g. we introduce KaxÜberTags (v5 element) which may
> include the already existing KaxTag elements (v4).
>
> In that situation a parser that only knows v1-v4 but not v5 could find
> itself in a situation where a KaxÜberTags master has an infinite size,
> but the parser would then erroneously see that KaxTag as the end of the
> unknown infinite-sized KaxÜberTags.
>
> So you may be right, and Steve might be wrong.

That could happen with global elements. But then global elements are
not supposed to change the context level, so in this case it's a non
issue.

With a common element (not global) shared by different parent that
could happen. I think such a case should be explained and be made
mutually exclusive with the use of unknown size elements in the EBML
specs. I think that's better than making unknown size elements being
allowed only when knowing the FULL schema. A condition already not met
in Matroska parsers.


More information about the Matroska-devel mailing list