Skip to content

Commit

Permalink
Fix dancasimiro#101, make read_tags skip extra \0 bytes
Browse files Browse the repository at this point in the history
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
  • Loading branch information
cHemingway authored Jun 16, 2021
1 parent 249b072 commit 99f366a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/WAVChunk.jl
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,12 @@ function read_tag(tags::Dict{Symbol, String}, t::Vector{UInt8})
end
tags[tag_id] = String(t[9:(i-1)])

# Skip the null terminator
t[(i+1):end]
# Skip null terminator/s, repeat in case multiple are present
while t[i] == 0 && i < length(t)
i += 1
end
# Return remainder of t
return t[i:end]
end

"""
Expand Down

0 comments on commit 99f366a

Please sign in to comment.