Skip to content

[1.x] KaxBlock: rework EBML lacing sizes in SCOPE_PARTIAL_DATA mode#237

Open
robUx4 wants to merge 3 commits into
Matroska-Org:v1.xfrom
robUx4:1x-partial-ebml-lacing
Open

[1.x] KaxBlock: rework EBML lacing sizes in SCOPE_PARTIAL_DATA mode#237
robUx4 wants to merge 3 commits into
Matroska-Org:v1.xfrom
robUx4:1x-partial-ebml-lacing

Conversation

@robUx4
Copy link
Copy Markdown
Contributor

@robUx4 robUx4 commented Apr 28, 2026

We only read the bytes that correspond to frame sizes, rather
than a guesstimate of how much data we are going to need.

That's what the SCOPE_PARTIAL_DATA mode is about. This is already the case
for LACING_XIPH. And we don't need a buffer allocation.

And throw when the EBML length difference gives a negative frame length.

robUx4 added 2 commits April 28, 2026 11:41
We only read the bytes that correspond to frame sizes, rather
than a guesstimate of how much data we are going to need.

That's what the SCOPE_PARTIAL_DATA mode is about. This is already the case
for LACING_XIPH. And we don't need a buffer allocation.
@robUx4 robUx4 added the bug label Apr 28, 2026
Comment thread src/KaxBlock.cpp
The spec [^1] is not clear whether when there is a single frame in the lace
the size of the frame should be written. However it is forbidden to put
a single frame in a lace [^2]. libmatroska doesn't support it.
libavformat doesn't support lacing writing.
However the last frame size is never written in any lace, so that's the
first one when there's only one frame.

[^1]: https://www.rfc-editor.org/rfc/rfc9559#section-10.3.3
[^2]: https://www.rfc-editor.org/rfc/rfc9559#section-10.3
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.

1 participant