Skip to content

Fix IAMF specific box parsing bug in MP4 demuxer#11543

Open
osagie98 wants to merge 1 commit into
youtube:26.eapfrom
osagie98:fix-iamf-parse-bug
Open

Fix IAMF specific box parsing bug in MP4 demuxer#11543
osagie98 wants to merge 1 commit into
youtube:26.eapfrom
osagie98:fix-iamf-parse-bug

Conversation

@osagie98

@osagie98 osagie98 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

The IamfSpecificBox::Parse method previously sliced the buffer from the
start of the box header instead of the current reader position. This
resulted in the IAMF configuration OBUs being parsed incorrectly
because the offset from previous reads within the box was not being
respected.

Issue: 537956110

@osagie98
osagie98 requested a review from a team as a code owner July 24, 2026 22:19

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the buffer offset in IamfSpecificBox::Parse within media/formats/mp4/box_definitions.cc to use the current reader position. However, a critical security vulnerability was identified: the code does not validate whether the reader has enough remaining bytes before creating the span and copying its contents. This could lead to an out-of-bounds read if config_obus_size is larger than the remaining buffer size. It is recommended to add a validation check using reader->HasBytes(config_obus_size) before accessing the buffer.

Comment thread media/formats/mp4/box_definitions.cc
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


media: Fix IAMF box parsing in MP4 demuxer

The IamfSpecificBox::Parse method previously sliced the buffer from the
start of the box header instead of the current reader position. This
resulted in the IAMF configuration OBUs being parsed incorrectly
because the offset from previous reads within the box was not being
respected.

Issue: 537956110

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

Fix IamfSpecificBox::Parse() to slice buffer from current position
(reader->pos()) rather than offset 0 of the box header. Previously the
offset wasn't respected, causing the box to be parsed incorrectly.

Issue: 537956110
Change-Id: Ib11dcbc3af0940d987e8ad23c0595e86e513a216
@osagie98
osagie98 force-pushed the fix-iamf-parse-bug branch from 3e4e6f2 to f32c464 Compare July 24, 2026 22:31
@osagie98
osagie98 requested a review from andrewsavage1 July 24, 2026 22:31

@borongc borongc left a comment

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.

RS approval, and waiting for our partners to verify it.

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