diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2008-06-29 02:19:53 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2008-06-29 02:19:53 +0000 |
| commit | 8f3175b77909206d2764295a9160882ce943575f (patch) | |
| tree | 81d7373edbe7a94b68de2772c085d6ef253d6a0c | |
| parent | 475c2e7d0518152c00fed75de40b83a66abdcbed (diff) | |
| download | rockbox-8f3175b77909206d2764295a9160882ce943575f.zip rockbox-8f3175b77909206d2764295a9160882ce943575f.tar.gz rockbox-8f3175b77909206d2764295a9160882ce943575f.tar.bz2 rockbox-8f3175b77909206d2764295a9160882ce943575f.tar.xz | |
fix FS#9119 (crash if random folder list has no entries)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17862 a1c6a512-1295-4272-9138-f99709370657
| -rw-r--r-- | apps/playlist.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 280d6dc..8f800f6 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -1486,6 +1486,8 @@ static int get_next_dir(char *dir, bool is_forward, bool recursion) if (fd >= 0) { read(fd,&folder_count,sizeof(int)); + if (!folder_count) + exit = true; while (!exit) { i = rand()%folder_count; @@ -1494,7 +1496,8 @@ static int get_next_dir(char *dir, bool is_forward, bool recursion) if (check_subdir_for_music(buffer,"") ==0) exit = true; } - strcpy(dir,buffer); + if (folder_count) + strcpy(dir,buffer); close(fd); *(tc->dirfilter) = dirfilter; reload_directory(); |