Skip to content

Use of uninitialized memory in ivas_omasa_param_est_ana_fx leading to renderer crash

Basic info

  • Fixed point:

Bug description

External renderer OMASA to MASA output with a 16 kHz input crashes on assertion error:

IVAS_rend: lib_com/basop32.c:2332: L_shl: Assertion `0' failed.

or on a different run

IVAS_rend: lib_com/basop32.c:2340: L_shl: Assertion `0' failed

The error is observed on Linux system, but not under Mac.

Valgrind analysis shows that uninitialized memory is being used.

==509237== Conditional jump or move depends on uninitialised value(s)
==509237==    at 0x40D60C: L_shr (basop32.c:2463)
==509237==    by 0x1976C2: ivas_omasa_param_est_ana_fx (ivas_omasa_ana_fx.c:466)
==509237==    by 0x196D39: ivas_omasa_ana_fx (ivas_omasa_ana_fx.c:297)
==509237==    by 0x124320: renderIsmToMasa (lib_rend_fx.c:5583)
==509237==    by 0x1245BC: renderInputIsm (lib_rend_fx.c:5652)
==509237==    by 0x1246FE: renderActiveInputsIsm (lib_rend_fx.c:5697)
==509237==    by 0x129DFB: getSamplesInternal (lib_rend_fx.c:7349)
==509237==    by 0x129F7B: IVAS_REND_GetSamples (lib_rend_fx.c:7390)
==509237==    by 0x111933: main (renderer.c:1491)
==509237==  Uninitialised value was created by a stack allocation
==509237==    at 0x196E5A: ivas_omasa_param_est_ana_fx (ivas_omasa_ana_fx.c:330)
==509237== 
==509237== Conditional jump or move depends on uninitialised value(s)
==509237==    at 0x40D60C: L_shr (basop32.c:2463)
==509237==    by 0x19772E: ivas_omasa_param_est_ana_fx (ivas_omasa_ana_fx.c:468)
==509237==    by 0x196D39: ivas_omasa_ana_fx (ivas_omasa_ana_fx.c:297)
==509237==    by 0x124320: renderIsmToMasa (lib_rend_fx.c:5583)
==509237==    by 0x1245BC: renderInputIsm (lib_rend_fx.c:5652)
==509237==    by 0x1246FE: renderActiveInputsIsm (lib_rend_fx.c:5697)
==509237==    by 0x129DFB: getSamplesInternal (lib_rend_fx.c:7349)
==509237==    by 0x129F7B: IVAS_REND_GetSamples (lib_rend_fx.c:7390)
==509237==    by 0x111933: main (renderer.c:1491)
==509237==  Uninitialised value was created by a stack allocation
==509237==    at 0x196E5A: ivas_omasa_param_est_ana_fx (ivas_omasa_ana_fx.c:330)
==509237== 
==509237== Conditional jump or move depends on uninitialised value(s)
==509237==    at 0x40D60C: L_shr (basop32.c:2463)
==509237==    by 0x1978DC: ivas_omasa_param_est_ana_fx (ivas_omasa_ana_fx.c:489)
==509237==    by 0x196D39: ivas_omasa_ana_fx (ivas_omasa_ana_fx.c:297)
==509237==    by 0x124320: renderIsmToMasa (lib_rend_fx.c:5583)
==509237==    by 0x1245BC: renderInputIsm (lib_rend_fx.c:5652)
==509237==    by 0x1246FE: renderActiveInputsIsm (lib_rend_fx.c:5697)
==509237==    by 0x129DFB: getSamplesInternal (lib_rend_fx.c:7349)
==509237==    by 0x129F7B: IVAS_REND_GetSamples (lib_rend_fx.c:7390)
==509237==    by 0x111933: main (renderer.c:1491)
==509237==  Uninitialised value was created by a stack allocation
==509237==    at 0x196E5A: ivas_omasa_param_est_ana_fx (ivas_omasa_ana_fx.c:330)
==509237== 
==509237== Conditional jump or move depends on uninitialised value(s)
==509237==    at 0x40D60C: L_shr (basop32.c:2463)
==509237==    by 0x19796D: ivas_omasa_param_est_ana_fx (ivas_omasa_ana_fx.c:491)
==509237==    by 0x196D39: ivas_omasa_ana_fx (ivas_omasa_ana_fx.c:297)
==509237==    by 0x124320: renderIsmToMasa (lib_rend_fx.c:5583)
==509237==    by 0x1245BC: renderInputIsm (lib_rend_fx.c:5652)
==509237==    by 0x1246FE: renderActiveInputsIsm (lib_rend_fx.c:5697)
==509237==    by 0x129DFB: getSamplesInternal (lib_rend_fx.c:7349)
==509237==    by 0x129F7B: IVAS_REND_GetSamples (lib_rend_fx.c:7390)
==509237==    by 0x111933: main (renderer.c:1491)
==509237==  Uninitialised value was created by a stack allocation
==509237==    at 0x196E5A: ivas_omasa_param_est_ana_fx (ivas_omasa_ana_fx.c:330)
==509237== 
==509237== Conditional jump or move depends on uninitialised value(s)
==509237==    at 0x40CBAA: L_add (basop32.c:1656)
==509237==    by 0x516F77: v_multc_acc_32_16 (ivas_tools_fx.c:1958)
==509237==    by 0x1982C2: ivas_omasa_param_est_ana_fx (ivas_omasa_ana_fx.c:577)
==509237==    by 0x196D39: ivas_omasa_ana_fx (ivas_omasa_ana_fx.c:297)
==509237==    by 0x124320: renderIsmToMasa (lib_rend_fx.c:5583)
==509237==    by 0x1245BC: renderInputIsm (lib_rend_fx.c:5652)
==509237==    by 0x1246FE: renderActiveInputsIsm (lib_rend_fx.c:5697)
==509237==    by 0x129DFB: getSamplesInternal (lib_rend_fx.c:7349)
==509237==    by 0x129F7B: IVAS_REND_GetSamples (lib_rend_fx.c:7390)
==509237==    by 0x111933: main (renderer.c:1491)
==509237==  Uninitialised value was created by a stack allocation
==509237==    at 0x196E5A: ivas_omasa_param_est_ana_fx (ivas_omasa_ana_fx.c:330)

The error was observed both with main and MR !1733 (merged) that is touching the same function.

Ways to reproduce

Using STV content with the META input the file stvOMASA_3ISM_1MASA2TC16c.txt having the content

stvOMASA_3ISM_1MASA2TC16c.wav
4
ISM
1
stvOMASA_3ISM_1MASA2TC48c_ISM1.csv
ISM
2
stvOMASA_3ISM_1MASA2TC48c_ISM2.csv
ISM
3
stvOMASA_3ISM_1MASA2TC48c_ISM3.csv
MASA
4
2
stvOMASA_3ISM_1MASA2TC48c.met

Command line:

IVAS_rend -q -if meta -i scripts/testv/stvOMASA_3ISM_1MASA2TC16c.txt -fs 16 -of MASA2 -o 0215_stvOMASA_3ISM_1MASA2TC16c.wav_MASA2.wav