Possible crash (saturation) in ITF_Detect_fx
with a7716790 and this bitstream : p10_st_48k_-stereo_-dtx_32000_48.bit
a crash du to saturation is happening at frame 577 in the function ITF_Detect_fx() from the file tns_base.c Ln576.
move16();
shift = shifts[iSubdivisions];
n = sub( iEndLine, iStartLine );
assert( n < (Word16) ( sizeof( tmpbuf ) / sizeof( Word16 ) ) );
FOR( i = 0; i < n; i++ )
{
-->>> tmpbuf[i] = round_fx( L_shl( pSpectrum[iStartLine + i - IGF_START_MN], shift ) );
move16();
}
Replacing with
move16();
shift = shifts[iSubdivisions];
n = sub( iEndLine, iStartLine );
assert( n < (Word16) ( sizeof( tmpbuf ) / sizeof( Word16 ) ) );
FOR( i = 0; i < n; i++ )
{
tmpbuf[i] = round_fx_sat( L_shl_sat( pSpectrum[iStartLine + i - IGF_START_MN], shift ) );
move16();
}
would solve the problem and from the synthesis quality point view seems ok. I will create a MR, but would ask someone from FhG? to confirm it.