diff options
-rw-r--r-- | apps/playlist.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 80685f8655..b349799269 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -1828,7 +1828,8 @@ static int get_next_index(const struct playlist_info* playlist, int steps, | |||
1828 | } | 1828 | } |
1829 | 1829 | ||
1830 | /* No luck if the whole playlist was bad. */ | 1830 | /* No luck if the whole playlist was bad. */ |
1831 | if (playlist->indices[next_index] & PLAYLIST_SKIPPED) | 1831 | if (next_index < 0 || next_index >= playlist->amount || |
1832 | playlist->indices[next_index] & PLAYLIST_SKIPPED) | ||
1832 | return -1; | 1833 | return -1; |
1833 | 1834 | ||
1834 | return next_index; | 1835 | return next_index; |