aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClayton Smith <argilo@gmail.com>2021-12-16 13:18:39 -0500
committermormj <34754695+mormj@users.noreply.github.com>2021-12-20 11:49:43 -0500
commitdb626c1b23aa47a6a4c1138b405fbe5809d803b5 (patch)
treeb5cb69f9492b9b367bd600085ea6901b0602f2e0
parentgr-dtv: Add energy normalization for DVB-S2X constellations. (diff)
downloadgnuradio-db626c1b23aa47a6a4c1138b405fbe5809d803b5.tar.xz
gnuradio-db626c1b23aa47a6a4c1138b405fbe5809d803b5.zip
qtgui: add bounds checks to calculation of d_fft_size_combo index
Signed-off-by: Clayton Smith <argilo@gmail.com>
-rw-r--r--gr-qtgui/lib/freqcontrolpanel.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/gr-qtgui/lib/freqcontrolpanel.cc b/gr-qtgui/lib/freqcontrolpanel.cc
index a58728887..c2bf1ceb4 100644
--- a/gr-qtgui/lib/freqcontrolpanel.cc
+++ b/gr-qtgui/lib/freqcontrolpanel.cc
@@ -243,6 +243,8 @@ void FreqControlPanel::setFFTAverage(float val)
void FreqControlPanel::toggleFFTSize(int val)
{
int index = static_cast<int>(round(logf(static_cast<float>(val)) / logf(2.0f))) - 5;
+ index = std::max(index, 0);
+ index = std::min(index, d_fft_size_combo->count() - 1);
d_fft_size_combo->setCurrentIndex(index);
}