Commit 8484c370 authored by Max Kellermann's avatar Max Kellermann

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.
parent 1d02318d
...@@ -123,10 +123,11 @@ playlist_tag_event(void) ...@@ -123,10 +123,11 @@ playlist_tag_event(void)
{ {
unsigned song; unsigned song;
if (playlist_state != PLAYLIST_STATE_PLAY) if (playlist_state != PLAYLIST_STATE_PLAY ||
playlist.current < 0)
return; return;
assert(playlist.current >= 0); assert((unsigned)playlist.current < playlist.length);
song = playlist.order[playlist.current]; song = playlist.order[playlist.current];
playlist.songMod[song] = playlist.version; playlist.songMod[song] = playlist.version;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment