From cfaa6a7d55b46f739f54addbd037875b313378f7 Mon Sep 17 00:00:00 2001 From: Aleksey <42095512+redlex-spb@users.noreply.github.com> Date: Sun, 19 Sep 2021 16:23:20 +0300 Subject: [PATCH] Apply suggestions from code review Co-authored-by: David Howden --- mp4.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mp4.go b/mp4.go index 3fe76da..a573ad4 100644 --- a/mp4.go +++ b/mp4.go @@ -638,7 +638,7 @@ func (m metadataMP4) readAtomData(r io.ReadSeeker, name string, size uint32, pro data = string(b) case "uint8": - if len(b) < 1 { + if len(b) == 0 { return fmt.Errorf("invalid encoding: expected at least %d bytes, for integer tag data, got %d", 1, len(b)) } data = getInt(b[len(b)-1:]) @@ -759,7 +759,7 @@ func (m metadataMP4) Composer() string { func (m metadataMP4) Genre() string { genre := m.getString(atoms.Name("genre")) - if len(genre) < 1 { + if len(genre) == 0 { genreID := m.getInt(atoms.Name("genre ID")) if genreID == 0 { genreID := m.getInt(atoms.Name("genre ID3v1 ID")) - 1