Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set mvhd/tkhd/mdhd version to 1 if duration is greater than u32::MAX #76

Merged
merged 1 commit into from
Jun 15, 2022

Conversation

nemosupremo
Copy link
Contributor

Currently the version of the mvhd, tkhd, and mdhd boxes default to 0 in the mp4 writer. This can be an issue if the duration of a track, as defined by the timescale, exceeds u32::MAX. If u32::MAX is exceeded, the duration will end up corrupted as the upper bytes are just truncated.

Alternatively, maybe the library should fail writing boxes when fields would overflow?

@alfg alfg merged commit 00385ba into alfg:master Jun 15, 2022
@alfg
Copy link
Owner

alfg commented Jun 15, 2022

Thanks!

jprochazk pushed a commit to jprochazk/mp4 that referenced this pull request Sep 18, 2024
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