Fix off-by-one error in the bounds check for restoring the active line

This commit is contained in:
Thomas Goyne 2014-04-23 06:22:18 -07:00
parent ec6f14eef4
commit 7b0b74fbb0
1 changed files with 1 additions and 1 deletions

View File

@ -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);
}