From b0c0af3a8774be371f7d173024ae631d4e3d04d9 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 15 Nov 2012 16:43:42 +0000 Subject: [PATCH] Don't let index exceed array bounds. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2735 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/decoder.f90 | 4 +++- mainwindow.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/decoder.f90 b/lib/decoder.f90 index a9602260e..60653c105 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -122,7 +122,9 @@ subroutine decoder(ntrSeconds,ndepth,nRxLog,c00) ndecoded=1 endif endif - ccfred(i-10:i+10)=0. + i1=max(ia,i-10) + i2=min(ib,i+10) + ccfred(i1:i2)=0. if(maxval(ccfred(ia:ib)).gt.3.0) go to 10 if(fgood.eq.0.0) then diff --git a/mainwindow.cpp b/mainwindow.cpp index 1c3256d05..0679c75f8 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,4 +1,4 @@ -//------------------------------------------------------------- MainWindow +//-------------------------------------------------------------- MainWindow #include "mainwindow.h" #include "ui_mainwindow.h" #include "devsetup.h"