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

mp4: Skip unexpected or empty "data" ilst atoms #261

Merged
merged 1 commit into from
Oct 2, 2023

Conversation

uklotzde
Copy link
Contributor

@uklotzde uklotzde commented Oct 2, 2023

Make use of ParsingMode and ignore invalid/unexpected ilst atoms that could safely be ignored.

I found a few affected files that are accepted by other MP4 parsers.

PS: It would be cool to include this in a v0.16.1 release soon.

let content_len = (data_atom.len - 16) as usize;
if content_len == 0 {
// We won't add empty atoms
return Ok(None);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This early return was wrong. The comment states that multiple "data" atoms could occur, but the function aborts on the first empty atom.

@Serial-ATA
Copy link
Owner

Thanks! I'm not surprised atoms other than data can appear. Bunch of weird unspecified features of MP4 files with everyone doing their own thing.

I'll get 0.16.1 out after looking into #260.

@Serial-ATA Serial-ATA merged commit 2b814cd into Serial-ATA:main Oct 2, 2023
12 checks passed
@uklotzde uklotzde deleted the mp4-parse-data-atoms branch October 3, 2023 18:38
@uklotzde
Copy link
Contributor Author

@Serial-ATA How about releasing v0.16.1 after various fixes have been merged?

@Serial-ATA
Copy link
Owner

I was going to release 0.16.1 after looking into that UTF-16 multi-value frame issue that was a part of #260. I just haven't been able to come up with a good solution yet.

@uklotzde
Copy link
Contributor Author

I was going to release 0.16.1 after looking into that UTF-16 multi-value frame issue that was a part of #260. I just haven't been able to come up with a good solution yet.

How do you extract the sample test data from the files?

Creating a draft PR with a failing test could be a good starting point for anyone to pick this up.

@Serial-ATA
Copy link
Owner

I just use a hex editor to either create tags by hand or just strip them out of files.

It may be beneficial to make a simple binary to dump out all of the tags. That would save people from having to do that or email me their assets. Can't say when/if I'll get that done, though.

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.

None yet

2 participants