Skip to content

Commit

Permalink
Fix buffer overflow
Browse files Browse the repository at this point in the history
Found by ASan on windows with msvc
  • Loading branch information
nico-abram authored May 23, 2020
1 parent 62d763f commit e77841a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Etterna/Models/Misc/TimingData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1488,7 +1488,7 @@ TimingData::BuildAndGetEtaner(const vector<int>& nerv)
event_row = bpms[i]->GetRow();
time_to_next_event = NoteRowToBeat(event_row - lastbpmrow) / bps;
float next_event_time = last_time + time_to_next_event;
while (nerv[idx] <= event_row && idx < nerv.size()) {
while (idx < nerv.size() && nerv[idx] <= event_row) {
float perc = (nerv[idx] - lastbpmrow) /
static_cast<float>(event_row - lastbpmrow);
ElapsedTimesAtNonEmptyRows.emplace_back(
Expand Down

0 comments on commit e77841a

Please sign in to comment.