Repository navigation
MP4: Fix freeform atom size validation - #599
Merged
Merged
Conversation
Contributor
Author
IssueM4A files with embedded cover art fail to extract artwork. The parser stops prematurely when encountering iTunes freeform atoms (----), never reaching the covr (cover art) atom. Root CauseIn lofty/src/mp4/atom_info.rs:276, the freeform chunk size validation incorrectly rejects atoms whose size exactly matches the remaining buffer space: // Before (incorrect)
if len >= *reader_size {
err!(SizeMismatch);
}
// After (correct)
if len > *reader_size {
err!(SizeMismatch);
}FixChanged >= to > to allow atoms that perfectly fill remaining space, which is valid per MP4 spec. Testing
|
Contributor
Author
|
Any news about this? |
Owner
|
Hey @M0Rf30, this makes sense. Just curious, do you have a file that triggers this? I don't think I've ever encountered a freeform atom without data |
Contributor
Author
Owner
|
Ah interesting, it just has a bunch of holes in the data. I was expecting some flag atoms. Still valid in any case. |
Co-authored-by: Serial <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change freeform chunk size check from >= to > to allow atoms that exactly fill the remaining space