Skip to content

Commit

Permalink
fps_metrics: don't try to access out of range
Browse files Browse the repository at this point in the history
  • Loading branch information
flightlessmango committed Jan 18, 2024
1 parent cfc51ec commit d4a66cc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/fps_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ class fpsMetrics {
}
it->display_name = stream.str();
uint64_t idx = val * sorted_values.size() - 1;
if (idx >= sorted_values.size())
break;

it->value = sorted_values[idx];
++it;
} catch (const std::invalid_argument& e) {
Expand Down

0 comments on commit d4a66cc

Please sign in to comment.