diff --git a/Core/CoreTiming.cpp b/Core/CoreTiming.cpp index 57093d17ae..7b25787fdc 100644 --- a/Core/CoreTiming.cpp +++ b/Core/CoreTiming.cpp @@ -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")); diff --git a/Core/HLE/sceSas.cpp b/Core/HLE/sceSas.cpp index 5c4c71a92b..3dd69b5b94 100644 --- a/Core/HLE/sceSas.cpp +++ b/Core/HLE/sceSas.cpp @@ -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() {