playlist: convert assertion to check in TAG event handler
It is possible that playlist.current is reset before the TAG event handler playlist_tag_event() is called. Convert the assertion into a run-time check.
This commit is contained in:
parent
1d02318d21
commit
8484c3708b
|
@ -123,10 +123,11 @@ playlist_tag_event(void)
|
|||
{
|
||||
unsigned song;
|
||||
|
||||
if (playlist_state != PLAYLIST_STATE_PLAY)
|
||||
if (playlist_state != PLAYLIST_STATE_PLAY ||
|
||||
playlist.current < 0)
|
||||
return;
|
||||
|
||||
assert(playlist.current >= 0);
|
||||
assert((unsigned)playlist.current < playlist.length);
|
||||
|
||||
song = playlist.order[playlist.current];
|
||||
playlist.songMod[song] = playlist.version;
|
||||
|
|
Loading…
Reference in New Issue