From 2cbec0cf93b9440f9ac3660ab50c3b6cfd3a0d86 Mon Sep 17 00:00:00 2001 From: David Howden Date: Sun, 24 May 2015 13:13:32 +1000 Subject: [PATCH] Fix panic when len(result[1]) == 0 --- id3v2frames.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/id3v2frames.go b/id3v2frames.go index d90dc11..5db68e8 100644 --- a/id3v2frames.go +++ b/id3v2frames.go @@ -79,7 +79,10 @@ func dataSplit(b []byte, enc byte) ([][]byte, error) { result := bytes.SplitN(b, delim, 2) if len(result) != 2 { + return result, nil + } + if len(result[1]) == 0 { return result, nil }