Fix off-by-one error in the bounds check for restoring the active line
This commit is contained in:
parent
ec6f14eef4
commit
7b0b74fbb0
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue