1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Jonathan Gordon 2008-06-29 02:19:53 +00:00
parent 475c2e7d05
commit 8f3175b779

View file

@ -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,6 +1496,7 @@ static int get_next_dir(char *dir, bool is_forward, bool recursion)
if (check_subdir_for_music(buffer,"") ==0)
exit = true;
}
if (folder_count)
strcpy(dir,buffer);
close(fd);
*(tc->dirfilter) = dirfilter;