Protect against a potential bounds error.

This commit is contained in:
Joe Taylor 2018-08-31 10:47:31 -04:00
parent 45d48629d2
commit a8ad1569cc
1 changed files with 2 additions and 0 deletions

View File

@ -105,6 +105,8 @@ subroutine sync8(dd,nfa,nfb,syncmin,nfqso,ldecode77,maxcand,s,candidate,ncand,sb
iz=ib-ia+1
call indexx(red(ia:ib),iz,indx)
ibase=indx(nint(0.40*iz)) - 1 + ia
if(ibase.lt.1) ibase=1
if(ibase.gt.nh1) ibase=nh1
base=red(ibase)
red=red/base