Check each ID3 tag is valid.
Some tag encoders like to use non-standard padding (see http://id3.org/Compliance%20Issues) which was causing "unexpected EOF" errors. Checking that each tag has a valid name (as per the spec) seems to be the only good way around this.
This commit is contained in:
@@ -167,6 +167,12 @@ func readID3v2Frames(r io.Reader, h *ID3v2Header) (map[string]interface{}, error
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Avoid corrupted padding (see http://id3.org/Compliance%20Issues).
|
||||
if !validID3Frame(h.Version, name) {
|
||||
break
|
||||
}
|
||||
|
||||
// FIXME: Do we still need this?
|
||||
// if size=0, we certainly are in a padding zone. ignore the rest of
|
||||
// the tags
|
||||
if size == 0 {
|
||||
|
||||
Reference in New Issue
Block a user