Crash in stereo decoding in DTX and bitrate switching
When looking at #1559, I noticed another issue in DTX and bitrate switching with a different database. Running
ivas_cod -stereo -dtx scripts/switchPaths/sw_13k2_to_128k_10fr.bin 48 inp bit
ivas_dec stereo 48 bit syn
results in a crash when switching from the TD stereo active frame (32 kbps) to the MDCT stereo SID frame (5.2 kbps). The crash happens in acelp_core_dec() at condition
if ( st->hPFstat->on != 0 )
{
...
}
due to st->hPFstat being uninitialized.
Unfortunately, I cannot share the database used.
Regardless of the DTX logic that needs to be reviewed due to #1559, I propose a fix which consists in
#ifdef FIX
if ( st->hPFstat != NULL && st->hPFstat->on != 0 )
#else
if ( st->hPFstat->on != 0 )
#endif
{
...
}