Skip to content

Conversation

@robUx4
Copy link
Contributor

@robUx4 robUx4 commented Jul 25, 2025

When an element from an upper level is found we go up the caller chain, passing the found element but it was not actually used (added to a list or freed).

This patch allows setting that element as the ElementLevelA found in the loop. We skip the call the inDataStream.FindNextElement() to find it.

The new MaxSizeToRead is the size to read in the next inDataStream.FindNextElement() call.

The old MaxSizeToRead <= 0 code seems bogus as it would exit the loop to find elements for that EbmlMaster even though there might still be elements to read.

When an element from an upper level is found we go up the caller chain,
passing the found element but it was not actually used (added to a list or freed).

This patch allows setting that element as the ElementLevelA found in the loop.
We skip the call the inDataStream.FindNextElement() to find it.

The new MaxSizeToRead is the size to read in the next inDataStream.FindNextElement() call.

The old MaxSizeToRead <= 0 code seems bogus as it would exit the loop
to find elements for that EbmlMaster even though there might still be elements to read.
@robUx4 robUx4 added the bug label Jul 25, 2025
ePirat pushed a commit to videolan/vlc that referenced this pull request Jul 30, 2025
This can happen in damaged files. Undamaged files are unaffected.

Sent for review upstream in Matroska-Org/libebml#321 / Matroska-Org/libebml#322
ePirat pushed a commit to videolan/vlc that referenced this pull request Aug 8, 2025
This can happen in damaged files. Undamaged files are unaffected.

Sent for review upstream in Matroska-Org/libebml#321 / Matroska-Org/libebml#322

(cherry picked from commit cace91a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants