Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic: runtime error: slice bounds out of range [:3] with capacity 1 #76

Closed
deluan opened this issue Oct 24, 2020 · 1 comment
Closed

Comments

@deluan
Copy link

deluan commented Oct 24, 2020

Found the above panic when reading tags from the following file: 03.-.Semblance.Of.Confusion.-.defect.zip

When using the tag command line. tool, I get this stack trace:

$ tag ~/Downloads/03\ -\ Semblance\ Of\ Confusion\ -\ defect.mp3
panic: runtime error: slice bounds out of range [:3] with capacity 1

goroutine 1 [running]:
github.com/dhowden/tag.readTextWithDescrFrame(0xc00008c0c8, 0x2, 0x2, 0x101, 0x1277b20, 0x0, 0x0)
	/Users/deluan/Development/go/src/github.com/dhowden/tag/id3v2frames.go:460 +0x46b
github.com/dhowden/tag.readID3v2Frames(0x1795008, 0xc00000e030, 0x4e, 0xc00008e000, 0xc00000e030, 0x0, 0x0)
	/Users/deluan/Development/go/src/github.com/dhowden/tag/id3v2.go:364 +0x8b7
github.com/dhowden/tag.ReadID3v2Tags(0x1173320, 0xc00000e030, 0x1, 0x0, 0x0, 0x0)
	/Users/deluan/Development/go/src/github.com/dhowden/tag/id3v2.go:428 +0xde
github.com/dhowden/tag.ReadFrom(0x1173320, 0xc00000e030, 0x0, 0x0, 0xc00000e030, 0x0)
	/Users/deluan/Development/go/src/github.com/dhowden/tag/tag.go:52 +0x324
main.main()
	/Users/deluan/Development/go/src/github.com/dhowden/tag/cmd/tag/main.go:46 +0x1be

Tried with other tag extractors (TagLib and ffmpeg) and they are both able to extract the tags. Ex. with tagreader from TagLib:

$ tagreader ~/Downloads/03\ -\ Semblance\ Of\ Confusion\ -\ defect.mp3
******************** "/Users/deluan/Downloads/03 - Semblance Of Confusion - defect.mp3" ********************
-- TAG (basic) --
title   - "Semblance Of Confusion"
artist  - "After Forever"
album   - "Prison of Desire"
year    - "2000"
comment - ""
track   - "3"
genre   - "Metal"
-- TAG (properties) --
ALBUM          - "Prison of Desire"
ARTIST         - "After Forever"
COMMENT        - ""
DATE           - "2000"
GENRE          - "Metal"
MEDIA          - "DIG"
TITLE          - "Semblance Of Confusion"
TRACKNUMBER    - "03"
URL            - ""
-- AUDIO --
bitrate     - 128
sample rate - 44100
channels    - 2
length      - 4:90

from navidrome/navidrome#596

Thanks!

@dhowden
Copy link
Owner

dhowden commented Nov 19, 2020

Added a change to return an error instead of triggering a panic here.

In my quick read of the spec [1] I couldn't find how to get around this without erroring, but I only did a very quick scan through! However, feel free to open another ticket with spec references if this should be updated.

[1] https://id3.org/

@dhowden dhowden closed this as completed Nov 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants