1
0
Fork 0
forked from len0rd/rockbox

FS#8375 - Fix division by zero using the random database selection in a near-empty subset. Thanks to Henri Valta.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15989 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Steve Bavin 2008-01-03 07:29:19 +00:00
parent 21abf6579f
commit c7a046dd1d
2 changed files with 3 additions and 0 deletions

View file

@ -1385,6 +1385,8 @@ int tagtree_enter(struct tree_context* c)
seek = dptr->extraseek; seek = dptr->extraseek;
if (seek == -1) if (seek == -1)
{ {
if(c->filesindir<=2)
return 0;
srand(current_tick); srand(current_tick);
dptr = (tagtree_get_entry(c, 2+(rand() % (c->filesindir-2)))); dptr = (tagtree_get_entry(c, 2+(rand() % (c->filesindir-2))));
seek = dptr->extraseek; seek = dptr->extraseek;

View file

@ -357,6 +357,7 @@ Jonas Hurrelmann
Lee Kang Hyuk Lee Kang Hyuk
Clemens Werther Clemens Werther
Robert Menes Robert Menes
Henri Valta
The libmad team The libmad team
The wavpack team The wavpack team