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

Panic with wav files #200

Closed
qarmin opened this issue Apr 5, 2023 · 4 comments · Fixed by #206
Closed

Panic with wav files #200

qarmin opened this issue Apr 5, 2023 · 4 comments · Fixed by #206

Comments

@qarmin
Copy link

qarmin commented Apr 5, 2023

thread 'main' panicked at 'index out of bounds: the len is 89 but the index is 184', /home/rafal/.cargo/git/checkouts/symphonia-8fbe6c90fc095688/b4ef823/symphonia-codec-adpcm/src/codec_ima.rs:51:20
stack backtrace:
   0: rust_begin_unwind
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/std/src/panicking.rs:575:5
   1: core::panicking::panic_fmt
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/panicking.rs:64:14
   2: core::panicking::panic_bounds_check
             at /rustc/2c8cc343237b8f7d5a3c3703e3a87f2eb2c54a74/library/core/src/panicking.rs:159:5
   3: symphonia_codec_adpcm::codec_ima::decode_mono
   4: <symphonia_codec_adpcm::AdpcmDecoder as symphonia_core::codecs::Decoder>::decode
   5: symphonia::main

Broken.zip

@dedobbin
Copy link
Contributor

Hey! I'm kinda looking into this.
It should definitely not crash, but when i play these files in audacity it also doesn't sound quite uh.. healthy.
Is there any context to these files? Is that the sound it's supposed to make ?

@qarmin
Copy link
Author

qarmin commented May 17, 2023

In my app I have option to find broken files, so users can find really strange files that crashes this library in many ways, so I try to find the files myself.

This files were found by fuzzer, so music inside probably is broken.

@dedobbin
Copy link
Contributor

From what i've seen while playing around, it plays some samples correct, but eventually reads an invalid value, which should be the key for the step table in symphonia-codec-adpcm/src/codec_ima.rs

I traced the code, to see if anything is off spec for ADPCM decoding. I found some leads but nothing definite.

@dedobbin
Copy link
Contributor

After discussing my findings with @pdeljanov a solution was found. Other applications seem to drop the data when such an impossible entry is found.

I can pick this up and implement this for this specific format as well.

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 a pull request may close this issue.

2 participants