From 0f6115b2289a1b17f419e03b97e05cd21d314cdd Mon Sep 17 00:00:00 2001 From: David Howden Date: Mon, 27 Apr 2015 22:55:59 +1000 Subject: [PATCH] Fixed panic on tag name length < 4 --- id3v2.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/id3v2.go b/id3v2.go index f5275d9..fece7fc 100644 --- a/id3v2.go +++ b/id3v2.go @@ -212,14 +212,14 @@ func readID3v2Frames(r io.Reader, h *ID3v2Header) (map[string]interface{}, error } result[name] = txt - case name[0:4] == "APIC": + case len(name) > 3 && name[0:4] == "APIC": p, err := readAPICFrame(b) if err != nil { return nil, err } result[name] = p - case name[0:3] == "PIC": + case len(name) > 2 && name[0:3] == "PIC": p, err := readPICFrame(b) if err != nil { return nil, err