Skip to content

Commit

Permalink
Fix: Track() for ID3v1.1 picked a wrong byte for the track number del…
Browse files Browse the repository at this point in the history
…imeter in

the comment field.
This results in neither the track number nor the comment being set properly.
  • Loading branch information
upperstream authored and dhowden committed Jul 16, 2016
1 parent c119c3e commit ae00514
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions id3v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,16 @@ func ReadID3v1Tags(r io.ReadSeeker) (Metadata, error) {
return nil, err
}

commentBytes, err := readBytes(r, 29)
commentBytes, err := readBytes(r, 30)
if err != nil {
return nil, err
}

var comment string
var track int
if commentBytes[27] == 0 {
if commentBytes[28] == 0 {
comment = strings.TrimSpace(string(commentBytes[:28]))
track = int(commentBytes[28])
track = int(commentBytes[29])
}

var genre string
Expand Down

0 comments on commit ae00514

Please sign in to comment.