diff options
author | Roman Artiukhin <bahusdrive@gmail.com> | 2024-02-03 15:54:14 +0200 |
---|---|---|
committer | Roman Artiukhin <bahusdrive@gmail.com> | 2024-02-03 16:01:22 +0200 |
commit | e122243bb0c80e582c15360d4c334345aefdc9c9 (patch) | |
tree | fc4f00cc74c424be38390f4d2a36a59c97b22ce2 | |
parent | 76ec55cc49e306a54ac7e43acf8a7f70ba7905a0 (diff) | |
download | rockbox-e122243bb0c80e582c15360d4c334345aefdc9c9.tar.gz rockbox-e122243bb0c80e582c15360d4c334345aefdc9c9.zip |
plugins: playing time: fix possible crash on sys event
Change-Id: I7b3580c56e2b285f56b9e2195fbf3c14b6cd96e5
-rw-r--r-- | apps/plugins/playing_time.c | 7 |
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) | |||
351 | if (rb->list_do_action(CONTEXT_LIST, HZ/2, &pt_lists, &key) == 0 | 351 | if (rb->list_do_action(CONTEXT_LIST, HZ/2, &pt_lists, &key) == 0 |
352 | && key!=ACTION_NONE && key!=ACTION_UNKNOWN) | 352 | && key!=ACTION_NONE && key!=ACTION_UNKNOWN) |
353 | { | 353 | { |
354 | bool usb = rb->default_event_handler(key) == SYS_USB_CONNECTED; | ||
355 | |||
356 | if (!usb && IS_SYSEVENT(key)) | ||
357 | continue; | ||
358 | |||
354 | rb->talk_force_shutup(); | 359 | rb->talk_force_shutup(); |
355 | return(rb->default_event_handler(key) == SYS_USB_CONNECTED); | 360 | return usb; |
356 | } | 361 | } |
357 | 362 | ||
358 | } | 363 | } |