summaryrefslogtreecommitdiff
path: root/apps/tagtree.c
diff options
context:
space:
mode:
authorMichael Hohmuth <sideral@rockbox.org>2011-08-04 10:21:52 +0000
committerMichael Hohmuth <sideral@rockbox.org>2011-08-04 10:21:52 +0000
commite7c2449d076a93cde988f6569c6bacd6e2d4562b (patch)
tree49d5d2c77c5af7e70f7757f0151948c3353666f1 /apps/tagtree.c
parent4cb473562e4602ce92c331631b491c910dea536c (diff)
Database: Fix array-bounds calculation when applying a format using
%strip to partially loaded (chunked) database results. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30247 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tagtree.c')
-rw-r--r--apps/tagtree.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c
index 0b16695ad1..31470722d5 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -1275,6 +1275,7 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init)
dptr->name = str(LANG_TAGNAVI_ALL_TRACKS);
dptr++;
current_entry_count++;
+ special_entry_count++;
}
if (offset <= 1)
{
@@ -1283,12 +1284,12 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init)
dptr->extraseek = -1;
dptr++;
current_entry_count++;
+ special_entry_count++;
}
- special_entry_count+=2;
+
+ total_count += 2;
}
- total_count += special_entry_count;
-
while (tagcache_get_next(&tcs))
{
if (total_count++ < offset)
@@ -1420,7 +1421,7 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init)
if (strip)
{
dptr = c->cache.entries;
- for (i = 0; i < total_count; i++, dptr++)
+ for (i = special_entry_count; i < current_entry_count; i++, dptr++)
{
int len = strlen(dptr->name);