1
0
Fork 0
forked from len0rd/rockbox

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
This commit is contained in:
Michael Sevakis 2014-06-20 04:54:18 -04:00
parent a77c6b9d96
commit 221c495432

View file

@ -842,8 +842,9 @@ static int shrink_callback(int handle, unsigned hints, void* start, size_t old_s
bool play_queued = queue_peek_ex(&audio_queue, &ev, QPEEK_REMOVE_EVENTS,
filter_list);
if (playing && ev.data != (intptr_t)&resume)
if (playing && (elapsed > 0 || offset > 0))
{
if (play_queued)
resume = *(struct audio_resume_info *)ev.data;
/* current id3->elapsed/offset are king */