UBSAN: Index out-of-bounds in SNS AVQ decoder
==================================================================================================
IVAS Codec Baseline
Based on EVS Codec (Floating Point) 3GPP TS26.443 Nov 04, 2021,
Version 12.14.0 / 13.10.0 / 14.6.0 / 15.4.0 / 16.3.0
==================================================================================================
lib_dec/ivas_sns_dec.c:164:31: runtime error: index 16 out of bounds for type 'float [16]'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior lib_dec/ivas_sns_dec.c:164:31 in
There is an odd loop in sns_avq_dec():
else if ( q_type == 1 )
{
for ( i = 0; i < M; i++ )
{
SNS_Q[0][i] = SNS_Q[0][M + i];
}
SNS_Q is given to the function as
float SNS_Q[NB_DIV][M]
with NB_DIV = 2.
So M + i is outside the declared bounds of SNS_Q[0]. Maybe the loop should rather be:
else if ( q_type == 1 )
{
for ( i = 0; i < M; i++ )
{
SNS_Q[0][i] = SNS_Q[1][i];
}