forked from len0rd/rockbox
playlist_next() now returns NULL on excessive 'step' amounts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1940 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
e255798f44
commit
3625dedcce
1 changed files with 4 additions and 0 deletions
|
@ -74,6 +74,10 @@ char* playlist_next(int steps, int* index)
|
|||
char dir_buf[MAX_PATH+1];
|
||||
char *dir_end;
|
||||
|
||||
if(abs(steps) > playlist.amount)
|
||||
/* prevent madness when all files are empty/bad */
|
||||
return NULL;
|
||||
|
||||
playlist.index = (playlist.index+steps) % playlist.amount;
|
||||
while ( playlist.index < 0 ) {
|
||||
if ( global_settings.loop_playlist )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue