playlist_edit: improved range checks in shufflePlaylist()
This commit is contained in:
parent
9fe459f625
commit
855466df40
|
@ -357,7 +357,12 @@ void shufflePlaylist(struct playlist *playlist, unsigned start, unsigned end)
|
||||||
{
|
{
|
||||||
const struct song *queued;
|
const struct song *queued;
|
||||||
|
|
||||||
if (end-1 <= start || end > queue_length(&playlist->queue))
|
if (end > queue_length(&playlist->queue))
|
||||||
|
/* correct the "end" offset */
|
||||||
|
end = queue_length(&playlist->queue);
|
||||||
|
|
||||||
|
if ((start+1) >= end)
|
||||||
|
/* needs at least two entries. */
|
||||||
return;
|
return;
|
||||||
|
|
||||||
queued = playlist_get_queued_song(playlist);
|
queued = playlist_get_queued_song(playlist);
|
||||||
|
|
Loading…
Reference in New Issue