Skip to content

Commit 619c680

Browse files
committed
mkv (ebml): Fix testing if the next element is a direct child of an ancestor.
When the parent element of the current element has an unknown size, the parent element ends if the next element is a direct child of any ancestor of the parent. This test, performed for each ancestor, requires the depth of the ancestor's child elements, and the ancestor's element ID. The pre-existing test passed the depth of the ancestor and not the depth of its children resulting in this test never passing. Fixes #541.
1 parent 5816cb3 commit 619c680

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

symphonia-format-mkv/src/ebml.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ impl<R: ReadEbml, S: EbmlSchema> EbmlIterator<R, S> {
536536
// parent element, then the parent element has ended. Return `None` in such a case.
537537
if parent_end.is_none() {
538538
for ancestor in self.stack.iter().rev().skip(1) {
539-
if header.is_valid_at(ancestor.depth, ancestor.id).unwrap_or(false) {
539+
if header.is_valid_at(ancestor.depth + 1, ancestor.id).unwrap_or(false) {
540540
// This element is a direct child of an ancestor. Iteration will be
541541
// terminated to indicate the end of the parent element.
542542
return Ok(None);

0 commit comments

Comments
 (0)