-
Notifications
You must be signed in to change notification settings - Fork 35
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
Extra \0 bytes in RIFF INFO tags causes wav_info_read() to raise ArgumentError #101
Comments
cHemingway
added a commit
to cHemingway/WAV.jl
that referenced
this issue
Jun 16, 2021
Some WAV files contain extra consecutive \0 bytes in RIFF INFO section, which causes issues if not skipped over properly. See dancasimiro#101 for details
CMGeldenhuys
added a commit
to CMGeldenhuys/WAV.jl
that referenced
this issue
Jun 21, 2021
Some WAVE files are not just padded with \0 bytes (null terminators) but arbitrary bytes. This causes the bug outlined in dancasimiro#101 & dancasimiro#102. Instead of looking for consecutive \0 bytes read size from CHUNK and ignore remainder of unused data. See dancasimiro#101, dancasimiro#102
CMGeldenhuys
added a commit
to CMGeldenhuys/WAV.jl
that referenced
this issue
Jun 21, 2021
Some WAVE files are not just padded with \0 bytes (null terminators) but arbitrary bytes. This causes the bug outlined in dancasimiro#101 & dancasimiro#102. Instead of looking for consecutive \0 bytes read size from CHUNK and ignore remainder of unused data. See dancasimiro#101, dancasimiro#102
An alternative fix might be to utilise the size field present in the subchunk block. This would allow one to skip arbitrary bytes instead of relying on the string being null padded beyond its null termination. |
dancasimiro
added a commit
that referenced
this issue
Jun 26, 2021
Fix #101, make read_tags skip extra arbitrary bytes
That fix looks better to me! I should have seen the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to read a file where extra padding/termination bytes are present in the RIFF INFO tags, so
wav_info_read(chunks)
throws an exception.This appears to be because the (private) function read_tag does not skip over multiple '\0' characters before returning the new list_data t.
Instead, it calls
return t[(i+1):end]
which would only skip one character.On the next call to
read_tag()
, the first line of the function will then attempt to execute:which will raise the ArgumentError as shown before.
I think I have a working fix for this, and will submit it as a pull request.
The text was updated successfully, but these errors were encountered: