mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-04-29 15:35:42 -04:00
System: Fix a possible crash with runahead
This commit is contained in:
parent
1f206421e8
commit
21d6af287e
@ -2306,8 +2306,11 @@ void DoRunahead()
|
|||||||
{
|
{
|
||||||
// we need to replay and catch up - load the state,
|
// we need to replay and catch up - load the state,
|
||||||
s_runahead_replay_pending = false;
|
s_runahead_replay_pending = false;
|
||||||
if (!LoadMemoryState(s_runahead_states.front()))
|
if (s_runahead_states.empty() || !LoadMemoryState(s_runahead_states.front()))
|
||||||
|
{
|
||||||
|
s_runahead_states.clear();
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// and throw away all the states, forcing us to catch up below
|
// and throw away all the states, forcing us to catch up below
|
||||||
// TODO: can we leave one frame here and run, avoiding the extra save?
|
// TODO: can we leave one frame here and run, avoiding the extra save?
|
||||||
@ -2365,7 +2368,7 @@ void DoMemorySaveStates()
|
|||||||
|
|
||||||
void SetRunaheadReplayFlag()
|
void SetRunaheadReplayFlag()
|
||||||
{
|
{
|
||||||
if (s_runahead_frames == 0)
|
if (s_runahead_frames == 0 || s_runahead_states.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Log_DevPrintf("Runahead rewind pending...");
|
Log_DevPrintf("Runahead rewind pending...");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user