New player logic in master branch can hit a panic when skipping passed the end of the play queue.
Steps to reproduce:
Start jamsonic with the -experimental flag.
Start playing the second to last song in an album.
Press "b" twice. Instead of just stopping the player tries to play an entry out of range which causes a panic.
Crash output:
panic: runtime error: makeslice: len out of range
goroutine 4 [running]:
github.com/TcM1911/jamsonic.(*playqueue).popSong(0xc42022e000, 0x0)
/[REDACTED]/TcM1911/jamsonic/player.go:331 +0xa5
github.com/TcM1911/jamsonic.(*playqueue).(github.com/TcM1911/jamsonic.popSong)-fm(0xc4201c7c48)
/[REDACTED]/TcM1911/jamsonic/player.go:182 +0x2a
github.com/TcM1911/jamsonic.(*Player).playNextInQueue(0xc4201c7c00, 0xc4207e1df0)
/[REDACTED]/TcM1911/jamsonic/player.go:260 +0x4d
github.com/TcM1911/jamsonic.(*Player).playerLoop(0xc4201c7c00)
/[REDACTED]/TcM1911/jamsonic/player.go:211 +0x78f
created by github.com/TcM1911/jamsonic.NewPlayer
/[REDACTED]/TcM1911/jamsonic/player.go:63 +0x2f4
New player logic in master branch can hit a panic when skipping passed the end of the play queue.
Steps to reproduce:
-experimental
flag.Crash output: