mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-12 08:37:25 -05:00
C4FM: bounds check the start of the buffer in the sync score (#2622)
A lagging sync detect on the first symbol after a buffer reload, followed by a coarse timing search that steps all the way left, scores a candidate whose first sync symbol is one sample before the buffer start. score() only checked the end of the buffer, so it threw ArrayIndexOutOfBoundsException: Index -1. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1313,7 +1313,7 @@ public abstract class C4FMSymbolProcessor
|
||||
|
||||
for(int x = 0; x < patternSymbols.length; x++)
|
||||
{
|
||||
if(bufferPointer < maxPointer)
|
||||
if(bufferPointer >= 0 && bufferPointer < maxPointer)
|
||||
{
|
||||
softSymbol = interpolate(mBuffer[bufferPointer], mBuffer[bufferPointer + 1], fractional) * gain + balance;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user