rgui_entry_iterate - some more safety checks
This commit is contained in:
parent
5b2c2343c0
commit
7521b9fcda
|
@ -46,6 +46,10 @@ typedef struct rgui_handle
|
||||||
static int rgui_entry_iterate(unsigned action)
|
static int rgui_entry_iterate(unsigned action)
|
||||||
{
|
{
|
||||||
const char *label = NULL;
|
const char *label = NULL;
|
||||||
|
|
||||||
|
if (!driver.menu || !driver.menu->menu_list)
|
||||||
|
return -1;
|
||||||
|
|
||||||
menu_file_list_cbs_t *cbs = (menu_file_list_cbs_t*)
|
menu_file_list_cbs_t *cbs = (menu_file_list_cbs_t*)
|
||||||
menu_list_get_actiondata_at_offset(driver.menu->menu_list->selection_buf,
|
menu_list_get_actiondata_at_offset(driver.menu->menu_list->selection_buf,
|
||||||
driver.menu->selection_ptr);
|
driver.menu->selection_ptr);
|
||||||
|
@ -55,10 +59,12 @@ static int rgui_entry_iterate(unsigned action)
|
||||||
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->set_texture)
|
if (driver.video_data && driver.menu_ctx && driver.menu_ctx->set_texture)
|
||||||
driver.menu_ctx->set_texture(driver.menu);
|
driver.menu_ctx->set_texture(driver.menu);
|
||||||
|
|
||||||
if (cbs && cbs->action_iterate)
|
if (!cbs)
|
||||||
return cbs->action_iterate(label, action);
|
return -1;
|
||||||
|
if (!cbs->action_iterate)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
return cbs->action_iterate(label, action);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rgui_copy_glyph(uint8_t *glyph, const uint8_t *buf)
|
static void rgui_copy_glyph(uint8_t *glyph, const uint8_t *buf)
|
||||||
|
|
Loading…
Reference in New Issue