mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix crash loading old savestates.
Oops. Forgot that this could be saved as -1 when loading an old savestate, and then resaving it. Fixes #8531.
This commit is contained in:
parent
da528d15ad
commit
666f1898c6
2 changed files with 5 additions and 1 deletions
|
@ -189,6 +189,7 @@ void AntiCrashCallback(u64 userdata, int cyclesLate)
|
|||
|
||||
void RestoreRegisterEvent(int event_type, const char *name, TimedCallback callback)
|
||||
{
|
||||
_assert_msg_(CORETIMING, event_type >= 0, "Invalid event type %d", event_type)
|
||||
if (event_type >= (int) event_types.size())
|
||||
event_types.resize(event_type + 1, EventType(AntiCrashCallback, "INVALID EVENT"));
|
||||
|
||||
|
|
|
@ -207,11 +207,14 @@ void __SasDoState(PointerWrap &p) {
|
|||
|
||||
if (s >= 2) {
|
||||
p.Do(sasMixEvent);
|
||||
CoreTiming::RestoreRegisterEvent(sasMixEvent, "SasMix", sasMixFinish);
|
||||
} else {
|
||||
sasMixEvent = -1;
|
||||
__SasDisableThread();
|
||||
}
|
||||
|
||||
if (sasMixEvent != -1) {
|
||||
CoreTiming::RestoreRegisterEvent(sasMixEvent, "SasMix", sasMixFinish);
|
||||
}
|
||||
}
|
||||
|
||||
void __SasShutdown() {
|
||||
|
|
Loading…
Add table
Reference in a new issue