summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoman Artiukhin <bahusdrive@gmail.com>2024-02-03 15:54:14 +0200
committerRoman Artiukhin <bahusdrive@gmail.com>2024-02-03 16:01:22 +0200
commite122243bb0c80e582c15360d4c334345aefdc9c9 (patch)
treefc4f00cc74c424be38390f4d2a36a59c97b22ce2
parent76ec55cc49e306a54ac7e43acf8a7f70ba7905a0 (diff)
downloadrockbox-e122243bb0.tar.gz
rockbox-e122243bb0.zip
plugins: playing time: fix possible crash on sys event
Change-Id: I7b3580c56e2b285f56b9e2195fbf3c14b6cd96e5
-rw-r--r--apps/plugins/playing_time.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/plugins/playing_time.c b/apps/plugins/playing_time.c
index 942513c499..354c5a3e06 100644
--- a/apps/plugins/playing_time.c
+++ b/apps/plugins/playing_time.c
@@ -351,8 +351,13 @@ static bool playing_time(void)
if (rb->list_do_action(CONTEXT_LIST, HZ/2, &pt_lists, &key) == 0
&& key!=ACTION_NONE && key!=ACTION_UNKNOWN)
{
+ bool usb = rb->default_event_handler(key) == SYS_USB_CONNECTED;
+
+ if (!usb && IS_SYSEVENT(key))
+ continue;
+
rb->talk_force_shutup();
- return(rb->default_event_handler(key) == SYS_USB_CONNECTED);
+ return usb;
}
}