From da31b024c2415109e02458fc6cbc40568d8862ec Mon Sep 17 00:00:00 2001 From: Allan Bazinet Date: Tue, 15 Jul 2025 14:13:18 -0700 Subject: [PATCH] Correct out of bounds array read Corrects out of bounds array read in waterfall display. --- plotter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plotter.cpp b/plotter.cpp index 67a461be..14bd1352 100644 --- a/plotter.cpp +++ b/plotter.cpp @@ -661,7 +661,9 @@ CPlotter::replot() else if constexpr (std::is_same_v) { - for (auto x = 0; x < width; ++x) + auto const end = std::min(width, static_cast(v.size())); + + for (auto x = 0; x < end; ++x) { p.setPen(colors[scaler(v[x])]); p.drawPoint(x, y);