summaryrefslogtreecommitdiff
path: root/apps/tagtree.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tagtree.c')
-rw-r--r--apps/tagtree.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/apps/tagtree.c b/apps/tagtree.c
index d03623b295..06239c4458 100644
--- a/apps/tagtree.c
+++ b/apps/tagtree.c
@@ -107,9 +107,6 @@ struct menu_entry {
107 int link; 107 int link;
108}; 108};
109 109
110#define TAGNAVI_VERSION "#! rockbox/tagbrowser/2.0"
111#define TAGMENU_MAX_ITEMS 32
112#define TAGMENU_MAX_MENUS 8
113struct root_menu { 110struct root_menu {
114 char title[64]; 111 char title[64];
115 char id[32]; 112 char id[32];
@@ -596,7 +593,10 @@ static bool parse_menu(const char *filename)
596 int i; 593 int i;
597 594
598 if (menu_count >= TAGMENU_MAX_MENUS) 595 if (menu_count >= TAGMENU_MAX_MENUS)
596 {
597 logf("max menucount reached");
599 return false; 598 return false;
599 }
600 600
601 fd = open(filename, O_RDONLY); 601 fd = open(filename, O_RDONLY);
602 if (fd < 0) 602 if (fd < 0)
@@ -659,6 +659,12 @@ static bool parse_menu(const char *filename)
659 break; 659 break;
660 660
661 case var_menu_start: 661 case var_menu_start:
662 if (menu_count >= TAGMENU_MAX_MENUS)
663 {
664 logf("max menucount reached");
665 return false;
666 }
667
662 if (get_token_str(menu->id, sizeof(menu->id)) < 0) 668 if (get_token_str(menu->id, sizeof(menu->id)) < 0)
663 { 669 {
664 logf("%menu_start id empty"); 670 logf("%menu_start id empty");
@@ -693,6 +699,12 @@ static bool parse_menu(const char *filename)
693 continue; 699 continue;
694 } 700 }
695 701
702 if (menu->itemcount >= TAGMENU_MAX_ITEMS)
703 {
704 logf("max itemcount reached");
705 continue;
706 }
707
696 /* Allocate */ 708 /* Allocate */
697 if (menu->items[menu->itemcount] == NULL) 709 if (menu->items[menu->itemcount] == NULL)
698 { 710 {