Skip to content

MSAN in MASA EXT metadata delay buffer indexing when starting with bad frames and no_delay_cmp

Basic info

Bug description

When no_delay_cmp is active the MASA metadata in EXT output is delayed by 2 or 3 subframes to synchronize it with the audio. If the signal starts with bad frames, the metadata filewriter is requested to use 0 delay. When the first good frame arrives, this results into a negative index in the delay buffer.

Ways to reproduce

cmake . -Bbuild-msan -DCMAKE_C_COMPILER=clang -DCLANG=msan
cmake --build build-msan -- -j
cd build-msan
./IVAS_cod -no_delay_cmp -masa 2 ../scripts/testv/stv2MASA2TC48c.met -max_band fb 13200 48 ../scripts/testv/stv2MASA2TC48c.met bit
../scripts/tools/Linux/networkSimulator_g192 ../scripts/dly_error_profiles/dly_error_profile_5.dat bit netsimoutput tracefile_sim 2 0
./IVAS_dec -no_delay_cmp -Tracefile tracefile_dec -VOIP EXT 48 netsimoutput out.wav

This should raise MSAN error.