1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Michael Hohmuth 2011-08-04 10:21:52 +00:00
parent 4cb473562e
commit e7c2449d07

View file

@ -1275,6 +1275,7 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init)
dptr->name = str(LANG_TAGNAVI_ALL_TRACKS); dptr->name = str(LANG_TAGNAVI_ALL_TRACKS);
dptr++; dptr++;
current_entry_count++; current_entry_count++;
special_entry_count++;
} }
if (offset <= 1) if (offset <= 1)
{ {
@ -1283,11 +1284,11 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init)
dptr->extraseek = -1; dptr->extraseek = -1;
dptr++; dptr++;
current_entry_count++; current_entry_count++;
} special_entry_count++;
special_entry_count+=2;
} }
total_count += special_entry_count; total_count += 2;
}
while (tagcache_get_next(&tcs)) while (tagcache_get_next(&tcs))
{ {
@ -1420,7 +1421,7 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init)
if (strip) if (strip)
{ {
dptr = c->cache.entries; 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); int len = strlen(dptr->name);