diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2014-06-20 04:54:18 -0400 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2014-06-20 04:54:18 -0400 |
commit | 221c4954324e78299cf27ca15fb8f78a24550e53 (patch) | |
tree | 3b53c57f8170b94c8701b71dc834093ec69ba8ba /apps | |
parent | a77c6b9d9693fe62a8625b3583f71b8415d7459b (diff) | |
download | rockbox-221c4954324e78299cf27ca15fb8f78a24550e53.tar.gz rockbox-221c4954324e78299cf27ca15fb8f78a24550e53.zip |
Fix a playback bug in shink_callback()
Invalid event data would be accessed if a play message isn't queued
which will cause crash problems.
It came about in the addition of time-based resume.
Change-Id: I1d5219064e2bf552b4183e9db4e7b380ffbe7a67
Diffstat (limited to 'apps')
-rw-r--r-- | apps/playback.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/apps/playback.c b/apps/playback.c index eba90f9a0a..efc23306a0 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -842,9 +842,10 @@ static int shrink_callback(int handle, unsigned hints, void* start, size_t old_s | |||
842 | bool play_queued = queue_peek_ex(&audio_queue, &ev, QPEEK_REMOVE_EVENTS, | 842 | bool play_queued = queue_peek_ex(&audio_queue, &ev, QPEEK_REMOVE_EVENTS, |
843 | filter_list); | 843 | filter_list); |
844 | 844 | ||
845 | if (playing && ev.data != (intptr_t)&resume) | 845 | if (playing && (elapsed > 0 || offset > 0)) |
846 | { | 846 | { |
847 | resume = *(struct audio_resume_info *)ev.data; | 847 | if (play_queued) |
848 | resume = *(struct audio_resume_info *)ev.data; | ||
848 | 849 | ||
849 | /* current id3->elapsed/offset are king */ | 850 | /* current id3->elapsed/offset are king */ |
850 | if (elapsed > 0) | 851 | if (elapsed > 0) |