From b9fccf3482f949e129881e586c2cedf00c049400 Mon Sep 17 00:00:00 2001 From: drowe67 Date: Tue, 23 Oct 2012 09:26:30 +0000 Subject: [PATCH] fixed wrong window dimensions, was reading past endof array and writing past end of bit map git-svn-id: https://svn.code.sf.net/p/freetel/code@795 01035d8c-6547-0410-b346-abe4f91aad63 --- fdmdv2/src/fdmdv2_plot_waterfall_linux.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fdmdv2/src/fdmdv2_plot_waterfall_linux.cpp b/fdmdv2/src/fdmdv2_plot_waterfall_linux.cpp index 0d0e2f00..2339b522 100644 --- a/fdmdv2/src/fdmdv2_plot_waterfall_linux.cpp +++ b/fdmdv2/src/fdmdv2_plot_waterfall_linux.cpp @@ -312,9 +312,11 @@ void PlotWaterfall::plotPixelData() { wxNativePixelData::Iterator rowStart = p; - for(px = 0; px < m_rCtrl.GetWidth(); px++) + for(px = 0; px < m_rGrid.GetWidth(); px++) { index = px * spec_index_per_px; + assert(index < FDMDV_NSPEC); + intensity = intensity_per_dB * (g_avmag[index] - MIN_DB); if(intensity > 255) intensity = 255; if (intensity < 0) intensity = 0; -- 2.25.1