From d8d6415505eeb318fe4140a4a25e63e35fc267f6 Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Mon, 13 Jan 2025 22:41:24 -0500 Subject: [PATCH] [BugFix] do_menu skinlist_draw dangling reference skinlist_draw stores a pointer to the list supplied if this pointer goes out of scope we may try to access it toggle_theme has a path to handle this but if you move to a a item with the theme enabled it doesn't release the pointer later the pointer will be referenced long after it has gone out of scope limiting this to do_menu() if other areas are problematic the previous version of this patch applies it system-wide Change-Id: I57c73d789856cb1a660fb704f02ca55c8978a4d0 --- apps/menu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/menu.c b/apps/menu.c index 61ff1b74e2..727255d837 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -769,7 +769,10 @@ int do_menu(const struct menu_item_ex *start_menu, int *start_selected, } FOR_NB_SCREENS(i) + { viewportmanager_theme_undo(i, false); + skinlist_set_cfg(i, NULL); /* Bugfix dangling reference in skin_draw() */ + } #ifdef HAVE_TOUCHSCREEN /* This is needed because this function runs the settings menu and we do * not want to switch back to the old mode if the user intentionally went