mirror of
https://github.com/odrling/Aegisub
synced 2025-04-11 22:56:02 +02:00
Fix off-by-one error in the bounds check for restoring the active line
This commit is contained in:
parent
ec6f14eef4
commit
7b0b74fbb0
@ -35,7 +35,7 @@ void SelectionController::OnSubtitlesOpen() {
|
||||
selection.clear();
|
||||
active_line = nullptr;
|
||||
if (!context->ass->Events.empty()) {
|
||||
int row = mid<int>(0, context->ass->GetUIStateAsInt("Active Line"), context->ass->Events.size());
|
||||
int row = mid<int>(0, context->ass->GetUIStateAsInt("Active Line"), context->ass->Events.size() - 1);
|
||||
active_line = &*std::next(context->ass->Events.begin(), row);
|
||||
selection.insert(active_line);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user