Skip to content

TOOLS/matroska.py: add size constraint for fixed size binary data#18151

Open
kasper93 wants to merge 3 commits into
mpv-player:masterfrom
kasper93:demux-mkv-size
Open

TOOLS/matroska.py: add size constraint for fixed size binary data#18151
kasper93 wants to merge 3 commits into
mpv-player:masterfrom
kasper93:demux-mkv-size

Conversation

@kasper93

Copy link
Copy Markdown
Member

No description provided.

kasper93 added 3 commits June 18, 2026 23:23
If we don't read the data it shouldn't set the element as present.
Those are fixed size per RFC and read as such in demux_mkv.c, fixes OOB
access in some cases that were missing the checks there.
After previous commit, those sizes are checked in parser.
Comment thread TOOLS/matroska.py
self.structname = "ebml_" + self.fieldname
self.elid = elid
self.valtype = valtype
self.length = int(length) if length is not None else 0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.length = int(length) if length is not None else 0
self.length = int(length or "0")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants