summaryrefslogtreecommitdiffstats
path: root/apps/root_menu.c
diff options
context:
space:
mode:
authorRafaël Carré <rafael.carre@gmail.com>2010-09-01 14:12:14 +0000
committerRafaël Carré <rafael.carre@gmail.com>2010-09-01 14:12:14 +0000
commit21c7b9debbade715f7cf79d04e5fe8b22d067c7b (patch)
tree636d77485b6fd91afd00dfa75b7e8a0fcb63fafa /apps/root_menu.c
parentff8089789b7977c8e80d0cded69711e088e6a3c2 (diff)
downloadrockbox-21c7b9debbade715f7cf79d04e5fe8b22d067c7b.tar.gz
rockbox-21c7b9debbade715f7cf79d04e5fe8b22d067c7b.tar.bz2
rockbox-21c7b9debbade715f7cf79d04e5fe8b22d067c7b.zip
load_plugin_screen(): handle all plugin_load() return values
Fixes crashes when pictureflow returns PLUGIN_GOTO_WPS git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27965 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/root_menu.c')
-rw-r--r--apps/root_menu.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/apps/root_menu.c b/apps/root_menu.c
index 7f882cdba3..0f2e38e395 100644
--- a/apps/root_menu.c
+++ b/apps/root_menu.c
@@ -558,9 +558,19 @@ static int load_plugin_screen(char *plug_path)
global_status.last_screen = (char)next_screen;
status_save();
- ret_val = plugin_load(plug_path, NULL);
- if (ret_val == PLUGIN_OK)
+ switch (plugin_load(plug_path, NULL))
+ {
+ case PLUGIN_GOTO_WPS:
+ ret_val = GO_TO_WPS;
+ break;
+ case PLUGIN_OK:
ret_val = audio_status() ? GO_TO_PREVIOUS : GO_TO_ROOT;
+ break;
+ default:
+ ret_val = GO_TO_PREVIOUS;
+ break;
+ }
+
if (ret_val == GO_TO_PREVIOUS)
last_screen = (old_previous == next_screen) ? GO_TO_ROOT : old_previous;
return ret_val;