summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2017-02-10 20:10:14 -0500
committerMichael Sevakis <jethead71@rockbox.org>2017-02-10 20:58:03 -0500
commit6436c6e749ab04fbd5d97804a6a1c3b3122b326d (patch)
tree0f5a8109c15e5f7ffb8021725719a4d791b149aa
parentf483a079508f100dcc3f654f674f387a40e5cd6a (diff)
downloadrockbox-6436c6e749ab04fbd5d97804a6a1c3b3122b326d.tar.gz
rockbox-6436c6e749ab04fbd5d97804a6a1c3b3122b326d.zip
Fix tagtree from blowing up when its buffer moves
I noticed that after booting with the external storage removed, playing from tagtree, inserting the card, forcing dircache to reallocate from the debug screen, and trying to reenter tagtree, it would data abort because the dircache reallaction to a larger size caused the tagtree buffer to move. Adjustment to at least one pointer (csi) was missed. Since it's non-trivial there to determine when things should be NULL and when they shouldn't, add check for menu too before moving it. As for the rest, who knows. Change-Id: Iea6538a2091b4b47083f39296555efc47edf8ba8
-rw-r--r--apps/tagtree.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c
index b3b94a489e..ba27c84f6a 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -201,7 +201,12 @@ static int move_callback(int handle, void* current, void* new)
201 if (lock_count > 0) 201 if (lock_count > 0)
202 return BUFLIB_CB_CANNOT_MOVE; 202 return BUFLIB_CB_CANNOT_MOVE;
203 203
204 UPDATE(menu, diff); 204 if (menu)
205 UPDATE(menu, diff);
206
207 if (csi)
208 UPDATE(csi, diff);
209
205 /* loop over menus */ 210 /* loop over menus */
206 for(int i = 0; i < menu_count; i++) 211 for(int i = 0; i < menu_count; i++)
207 { 212 {