-
Notifications
You must be signed in to change notification settings - Fork 149
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
Valid files(checked by FFprobe) aren't properly parsed in Symphonia #124
Comments
I don't know if their license allows looking at it, or taking inspiration from it, but FFmpeg does a more elaborate check during MP3 frame header synchronization; looking ahead in the buffer and scoring any candidates, then picking the one that looks best: https://github.com/FFmpeg/FFmpeg/blob/38238b604fb59ebaafe93dcf72e544cb33c4ac70/libavformat/mp3dec.c#L499-L547= |
I didn't try them all, but for all the MP3 files I tried, the issue seems to be within the ID3v2 parser being too strict. It's encountering a tag with size == 0 which is not allowed by the spec. and returning an error. That error then gets propagated and causes the entire stream to be rejected. With a bit of work, the parser can be made more lenient to allow this case. The WAV files seems to have a similar issue, but I'd need to look more deeply. As for the AC3 file, Symphonia does not support AC3. :) I don't think gaining mild inspiration is problematic, but FFMpeg is LGPL licensed and Symphonia is MPL licensed so copying isn't allowed since our license has fewer restrictions. Either way, for these issues it doesn't seem to be the packet parsing that's the issue. |
Okay, that's good! I just thought that it is a regression in 8f4aaed as it was explicitly mentioned. Sorry for the confusion. |
The broken MP3s should be fixed with the last two commits. |
Regarding the wave files:
|
See below analysis of the files in 0.6 branch: 1. mp3 with different types of frames: starts with mono, continue with stereo - there is a TODO in the code to implement support for this
2. invalid main_data offset, ffmpeg produces no errors (probably weak ffmpeg validation)
3. ID3v1 tag is present in the middle of the file, this is not allowed.
4. granule big_values > 288, this is not allowed
5. Other
|
This files fails to open with latest git symphonia version - 8f4aaed
FFprobe doesn't show any error with them
Code used to parse files - https://github.com/qarmin/audio_checker/blob/master/src/lib.rs
Example files
5 - The Music Of Stasis - Stars And The Moons - Meesah Kuteyi feat Mark Morgan.mp3.zip
08 - Crush.mp3.zip
idw_testsound.wav.zip
InFlux Original Soundtrack - 07 - Volcano Dance.mp3.zip
jetpack1.wav.zip
King of Dragon Pass - 24 - Danger.mp3.zip
Muzyka.ac3.zip
Neverwinter Nights 2 Storm of Zehir soundtrack - maintheme.mp3.zip
Robin Cook - Pandemia (54).mp3.zip
sample.wav.zip
The Way It Was.mp3.zip
The text was updated successfully, but these errors were encountered: