Reference decoder enters an infinite loop while decoding bitstreams generated on Cadence tools
While running encoder conformance tests using Cadence tools, we observed that the reference decoder enters int an infinite loop for 3 test cases. In these cases, the bitstreams were generated using an encoder binary built with Cadence tools. The encoder binary was compiled with the -O0 option, which disables all optimizations (so only deviation would be the math kernels as they come from optimized math libraries). We did not observe any issues during the encoding phase; however, a hang occurs during the decoding stage with the reference decoder binary.
The reference decoder binary was also built with the -O0 option using the standard Clang 18.1.6 compiler. This issues
The following decoder commands can be used to reproduce the issue:
1. Inifite loop after 191 frames : [stv1MASA2TC48n.wav_MASA_1dir_2TC_at_128_kbps_48kHz_in_48kHz_out_DTX_on_EXT_out.192](/uploads/911ebc1e5fdeecbb6371e2f29ab2975d/stv1MASA2TC48n.wav_MASA_1dir_2TC_at_128_kbps_48kHz_in_48kHz_out_DTX_on_EXT_out.192)
```
./IVAS_dec -fr 20 EXT 48 stv1MASA2TC48n.wav_MASA_1dir_2TC_at_128_kbps_48kHz_in_48kHz_out_DTX_on_EXT_out.192 stv1MASA2TC48n.wav_MASA_1dir_2TC_at_128_kbps_48kHz_in_48kHz_out_DTX_on_EXT_out_DEC.wav
```
2. Inifite loop after 191 frames [stv20sOMASA_2ISM2TC.wav_OMASA_vdir2TC_2ISM_at_256_kbps_48kHz_in_32kHz_out_BINAURAL_ROOM_IR_out.192](/uploads/c4e64ac16ae811504c2894fb52ce0d3b/stv20sOMASA_2ISM2TC.wav_OMASA_vdir2TC_2ISM_at_256_kbps_48kHz_in_32kHz_out_BINAURAL_ROOM_IR_out.192)
```
./IVAS_dec -fr 20 BINAURAL_ROOM_IR 32 stv20sOMASA_2ISM2TC.wav_OMASA_vdir2TC_2ISM_at_256_kbps_48kHz_in_32kHz_out_BINAURAL_ROOM_IR_out.192 stv20sOMASA_2ISM2TC.wav_OMASA_vdir2TC_2ISM_at_256_kbps_48kHz_in_32kHz_out_BINAURAL_ROOM_IR_out_DEC.wav
```
3. Inifite loop after 703 frames [stv20sOMASA_4ISM1TC.wav_OMASA_vdir1TC_4ISM_at_br_sw_techs_13_2_to_512_kbps_start_32_kbps_48kHz_in_48kHz_out_BINAURAL_out_FER_at_5_.192](/uploads/cdf7fafde6d165ff7dfdad26de3e6bf1/stv20sOMASA_4ISM1TC.wav_OMASA_vdir1TC_4ISM_at_br_sw_techs_13_2_to_512_kbps_start_32_kbps_48kHz_in_48kHz_out_BINAURAL_out_FER_at_5_.192)
```
./IVAS_dec -fr 20 BINAURAL 48 stv20sOMASA_4ISM1TC.wav_OMASA_vdir1TC_4ISM_at_br_sw_techs_13_2_to_512_kbps_start_32_kbps_48kHz_in_48kHz_out_BINAURAL_out_FER_at_5_.192 stv20sOMASA_4ISM1TC.wav_OMASA_vdir1TC_4ISM_at_br_sw_techs_13_2_to_512_kbps_start_32_kbps_48kHz_in_48kHz_out_BINAURAL_out_FER_at_5__DEC.wav
```
Our quick analysis indicated the program counter is stuck in following loop from lib_dec/ivas_masa_dec.c (line 1999)
```
while ( index >= 0 )
{
if ( valid_ratio_index( j, K, nchan_ism - 1 ) )
{
index--;
}
j++;
}
```
issue