Skip to content

Commit

Permalink
vorbis: fix panic on invalid encoding
Browse files Browse the repository at this point in the history
Fixes #33
  • Loading branch information
dhowden committed Feb 7, 2018
1 parent 1582ebc commit d449289
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vorbis.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ func (m *metadataVorbis) readVorbisComment(r io.Reader) error {
return err
}

if vendorLen < 0 {
return fmt.Errorf("invalid encoding: expected positive length, got %d", vendorLen)
}

vendor, err := readString(r, vendorLen)
if err != nil {
return err
Expand Down

0 comments on commit d449289

Please sign in to comment.