vorbis: fix panic on invalid encoding

Fixes #33
This commit is contained in:
David Howden 2018-02-07 18:35:49 +11:00
parent 1582ebc2a4
commit d449289c5e

View File

@ -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