forked from len0rd/rockbox
filetree.c add checks for invalid file entries
Admittedly I can not really think of a reason this would occur in normal use but if it does it'll result in a crash so better safe than sorry Change-Id: I593652bb658475bbd9a18026243c02524f5e7ccb
This commit is contained in:
parent
3f110daf30
commit
6f020ef155
1 changed files with 12 additions and 0 deletions
|
@ -436,6 +436,12 @@ int ft_enter(struct tree_context* c)
|
||||||
int rc = GO_TO_PREVIOUS;
|
int rc = GO_TO_PREVIOUS;
|
||||||
char buf[MAX_PATH];
|
char buf[MAX_PATH];
|
||||||
struct entry* file = tree_get_entry_at(c, c->selected_item);
|
struct entry* file = tree_get_entry_at(c, c->selected_item);
|
||||||
|
if (!file)
|
||||||
|
{
|
||||||
|
splashf(HZ, str(LANG_READ_FAILED), str(LANG_UNKNOWN));
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
int file_attr = file->attr;
|
int file_attr = file->attr;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
|
@ -680,6 +686,12 @@ int ft_enter(struct tree_context* c)
|
||||||
}
|
}
|
||||||
|
|
||||||
struct entry* file = tree_get_entry_at(c, c->selected_item);
|
struct entry* file = tree_get_entry_at(c, c->selected_item);
|
||||||
|
if (!file)
|
||||||
|
{
|
||||||
|
splashf(HZ, str(LANG_READ_FAILED), str(LANG_UNKNOWN));
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
plugin = filetype_get_plugin(file);
|
plugin = filetype_get_plugin(file);
|
||||||
if (plugin)
|
if (plugin)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue