summaryrefslogtreecommitdiff
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
parentff8089789b7977c8e80d0cded69711e088e6a3c2 (diff)
downloadrockbox-21c7b9debbade715f7cf79d04e5fe8b22d067c7b.tar.gz
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
-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)
558 global_status.last_screen = (char)next_screen; 558 global_status.last_screen = (char)next_screen;
559 status_save(); 559 status_save();
560 560
561 ret_val = plugin_load(plug_path, NULL); 561 switch (plugin_load(plug_path, NULL))
562 if (ret_val == PLUGIN_OK) 562 {
563 case PLUGIN_GOTO_WPS:
564 ret_val = GO_TO_WPS;
565 break;
566 case PLUGIN_OK:
563 ret_val = audio_status() ? GO_TO_PREVIOUS : GO_TO_ROOT; 567 ret_val = audio_status() ? GO_TO_PREVIOUS : GO_TO_ROOT;
568 break;
569 default:
570 ret_val = GO_TO_PREVIOUS;
571 break;
572 }
573
564 if (ret_val == GO_TO_PREVIOUS) 574 if (ret_val == GO_TO_PREVIOUS)
565 last_screen = (old_previous == next_screen) ? GO_TO_ROOT : old_previous; 575 last_screen = (old_previous == next_screen) ? GO_TO_ROOT : old_previous;
566 return ret_val; 576 return ret_val;