diff options
| author | Daniel Stenberg <daniel@haxx.se> | 2002-08-23 07:33:35 +0000 |
|---|---|---|
| committer | Daniel Stenberg <daniel@haxx.se> | 2002-08-23 07:33:35 +0000 |
| commit | 3625dedcce4a0ac81e74b0f0889ee741e7e2c0cf (patch) | |
| tree | a4ecaa76abaea4aa7ce1ca2ee202ad74ecf4524b | |
| parent | e255798f444c2856558e80b2078595fb2054fa08 (diff) | |
| download | rockbox-3625dedcce4a0ac81e74b0f0889ee741e7e2c0cf.zip rockbox-3625dedcce4a0ac81e74b0f0889ee741e7e2c0cf.tar.gz rockbox-3625dedcce4a0ac81e74b0f0889ee741e7e2c0cf.tar.bz2 rockbox-3625dedcce4a0ac81e74b0f0889ee741e7e2c0cf.tar.xz | |
playlist_next() now returns NULL on excessive 'step' amounts
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1940 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/playlist.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 0ac848c..7e8ea36 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -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 ) |