diff options
author | Peter D'Hoye <peter.dhoye@gmail.com> | 2007-04-11 22:39:12 +0000 |
---|---|---|
committer | Peter D'Hoye <peter.dhoye@gmail.com> | 2007-04-11 22:39:12 +0000 |
commit | b16137e10b0b309ccd9bf81fb2d70f24b090aa7d (patch) | |
tree | e889ada3d215d8366ac9cb376ba34fb074bf1a0a /apps/playlist_viewer.c | |
parent | d6e822cab9b4f1294a8789632c737d0d8f71ef58 (diff) | |
download | rockbox-b16137e10b0b309ccd9bf81fb2d70f24b090aa7d.tar.gz rockbox-b16137e10b0b309ccd9bf81fb2d70f24b090aa7d.zip |
Make sure selected track of playlist viewer doesn't become bigger than number of tracks when deleting the last track. Fixes FS #6899
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13113 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playlist_viewer.c')
-rw-r--r-- | apps/playlist_viewer.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/apps/playlist_viewer.c b/apps/playlist_viewer.c index d065ad32ce..e7558ea1ad 100644 --- a/apps/playlist_viewer.c +++ b/apps/playlist_viewer.c | |||
@@ -749,6 +749,8 @@ bool playlist_viewer_ex(char* filename) | |||
749 | update_playlist(true); | 749 | update_playlist(true); |
750 | if (viewer.num_tracks <= 0) | 750 | if (viewer.num_tracks <= 0) |
751 | exit = true; | 751 | exit = true; |
752 | if(viewer.selected_track >= viewer.num_tracks) | ||
753 | viewer.selected_track = viewer.num_tracks-1; | ||
752 | } | 754 | } |
753 | gui_synclist_draw(&playlist_lists); | 755 | gui_synclist_draw(&playlist_lists); |
754 | break; | 756 | break; |