check quicktime for 'ftype qt ' magic numbers #102
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.
This PR adds a match case for quicktime movie files that ignores the first four bytes of the first atom but looks for a Type of 'ftyp' and a Major Brand of 'qt '.
It seems that filetype sometimes fails to identify quicktime videos where the first four bytes aren't 0x0,0x0,0x0,0x14 and the 13-16th bytes aren't the type field for an mdat atom. Possibly this is when the first atom is a File Type Compatibility Atom. By adding a case where we ignore the first field (presumably Size) and instead match on the Type and Major Brand fields we hope to catch some mov files that would otherwise be missed.
For reference here is this doc from Apple https://developer.apple.com/library/archive/documentation/QuickTime/QTFF/QTFFChap1/qtff1.html#//apple_ref/doc/uid/TP40000939-CH203-CJBCBIFF which describes an atom that matches our case:
This is the first PR I've opened here so if there is any procedure I've missed please let me know.