diff options
author | Steve Bavin <pondlife@pondlife.me> | 2008-01-03 07:29:19 +0000 |
---|---|---|
committer | Steve Bavin <pondlife@pondlife.me> | 2008-01-03 07:29:19 +0000 |
commit | c7a046dd1dd4d1d1bde2f1e83a68073b54088384 (patch) | |
tree | 6d5325a0d23b354310a4d7d48e1d42f1379d8c45 | |
parent | 21abf6579fbfa1f46ccb7dc0857b76e8574a7ce5 (diff) | |
download | rockbox-c7a046dd1dd4d1d1bde2f1e83a68073b54088384.tar.gz rockbox-c7a046dd1dd4d1d1bde2f1e83a68073b54088384.zip |
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
-rw-r--r-- | apps/tagtree.c | 2 | ||||
-rw-r--r-- | docs/CREDITS | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c index d394491960..0163ddbb2f 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c | |||
@@ -1385,6 +1385,8 @@ int tagtree_enter(struct tree_context* c) | |||
1385 | seek = dptr->extraseek; | 1385 | seek = dptr->extraseek; |
1386 | if (seek == -1) | 1386 | if (seek == -1) |
1387 | { | 1387 | { |
1388 | if(c->filesindir<=2) | ||
1389 | return 0; | ||
1388 | srand(current_tick); | 1390 | srand(current_tick); |
1389 | dptr = (tagtree_get_entry(c, 2+(rand() % (c->filesindir-2)))); | 1391 | dptr = (tagtree_get_entry(c, 2+(rand() % (c->filesindir-2)))); |
1390 | seek = dptr->extraseek; | 1392 | seek = dptr->extraseek; |
diff --git a/docs/CREDITS b/docs/CREDITS index 91f841c214..f9dee10c3f 100644 --- a/docs/CREDITS +++ b/docs/CREDITS | |||
@@ -357,6 +357,7 @@ Jonas Hurrelmann | |||
357 | Lee Kang Hyuk | 357 | Lee Kang Hyuk |
358 | Clemens Werther | 358 | Clemens Werther |
359 | Robert Menes | 359 | Robert Menes |
360 | Henri Valta | ||
360 | 361 | ||
361 | The libmad team | 362 | The libmad team |
362 | The wavpack team | 363 | The wavpack team |