mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2025-12-16 12:08:49 +00:00
Fix off-by-one error in savestates that could cause crashes (#977)
This commit is contained in:
parent
939a6e0f7a
commit
493f59cef5
@ -1619,6 +1619,9 @@ void GMainWindow::UpdateSaveStates() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const auto& savestate : savestates) {
|
for (const auto& savestate : savestates) {
|
||||||
|
if (savestate.slot >= Core::SaveStateSlotCount) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const bool display_name =
|
const bool display_name =
|
||||||
savestate.status == Core::SaveStateInfo::ValidationStatus::RevisionDismatch &&
|
savestate.status == Core::SaveStateInfo::ValidationStatus::RevisionDismatch &&
|
||||||
!savestate.build_name.empty();
|
!savestate.build_name.empty();
|
||||||
@ -1659,7 +1662,7 @@ void GMainWindow::UpdateSaveStates() {
|
|||||||
for (u32 i = 1; i < Core::SaveStateSlotCount; ++i) {
|
for (u32 i = 1; i < Core::SaveStateSlotCount; ++i) {
|
||||||
if (!actions_load_state[i]->isEnabled()) {
|
if (!actions_load_state[i]->isEnabled()) {
|
||||||
// Prefer empty slot
|
// Prefer empty slot
|
||||||
oldest_slot = i + 1;
|
oldest_slot = i;
|
||||||
oldest_slot_time = 0;
|
oldest_slot_time = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user