diff options
author | Michael Hohmuth <sideral@rockbox.org> | 2011-08-04 10:21:52 +0000 |
---|---|---|
committer | Michael Hohmuth <sideral@rockbox.org> | 2011-08-04 10:21:52 +0000 |
commit | e7c2449d076a93cde988f6569c6bacd6e2d4562b (patch) | |
tree | 49d5d2c77c5af7e70f7757f0151948c3353666f1 | |
parent | 4cb473562e4602ce92c331631b491c910dea536c (diff) | |
download | rockbox-e7c2449d076a93cde988f6569c6bacd6e2d4562b.tar.gz rockbox-e7c2449d076a93cde988f6569c6bacd6e2d4562b.zip |
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
-rw-r--r-- | apps/tagtree.c | 9 |
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) | |||
1275 | dptr->name = str(LANG_TAGNAVI_ALL_TRACKS); | 1275 | dptr->name = str(LANG_TAGNAVI_ALL_TRACKS); |
1276 | dptr++; | 1276 | dptr++; |
1277 | current_entry_count++; | 1277 | current_entry_count++; |
1278 | special_entry_count++; | ||
1278 | } | 1279 | } |
1279 | if (offset <= 1) | 1280 | if (offset <= 1) |
1280 | { | 1281 | { |
@@ -1283,12 +1284,12 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init) | |||
1283 | dptr->extraseek = -1; | 1284 | dptr->extraseek = -1; |
1284 | dptr++; | 1285 | dptr++; |
1285 | current_entry_count++; | 1286 | current_entry_count++; |
1287 | special_entry_count++; | ||
1286 | } | 1288 | } |
1287 | special_entry_count+=2; | 1289 | |
1290 | total_count += 2; | ||
1288 | } | 1291 | } |
1289 | 1292 | ||
1290 | total_count += special_entry_count; | ||
1291 | |||
1292 | while (tagcache_get_next(&tcs)) | 1293 | while (tagcache_get_next(&tcs)) |
1293 | { | 1294 | { |
1294 | if (total_count++ < offset) | 1295 | if (total_count++ < offset) |
@@ -1420,7 +1421,7 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init) | |||
1420 | if (strip) | 1421 | if (strip) |
1421 | { | 1422 | { |
1422 | dptr = c->cache.entries; | 1423 | dptr = c->cache.entries; |
1423 | for (i = 0; i < total_count; i++, dptr++) | 1424 | for (i = special_entry_count; i < current_entry_count; i++, dptr++) |
1424 | { | 1425 | { |
1425 | int len = strlen(dptr->name); | 1426 | int len = strlen(dptr->name); |
1426 | 1427 | ||