diff --git a/id3v2frames.go b/id3v2frames.go index 569a609..ff5bc09 100644 --- a/id3v2frames.go +++ b/id3v2frames.go @@ -564,6 +564,10 @@ func (p Picture) String() string { // Description $00 (00) // Picture data func readPICFrame(b []byte) (*Picture, error) { + if len(b) < 5 { + return nil, errors.New("invalid PIC frame") + } + enc := b[0] ext := string(b[1:4]) picType := b[4]