Skip to content

Assert in gain_enc_mless_fx()

Basic info

Bug description

The BASOP Encoder crashes with an assert in gain_enc_mless_fx() (ACELP):

Stack trace:

#3  0x00007ffff7cb96e2 in __GI___assert_fail (assertion=0x5555559a77f2 "0", file=0x5555559a77e0 "lib_com/basop32.c", line=1061, function=0x5555559a782d <__PRETTY_FUNCTION__.4> "L_mult") at assert.c:103
#4  0x00005555557fbece in L_mult (var1=-32768, var2=-32768) at lib_com/basop32.c:1061
#5  0x000055555557fec4 in gain_enc_mless_fx (hBstr=0x555555ab4b80, gains_mode=0x555555ab4448, element_mode=1, L_frame=256, i_subfr=192, tc_subfr=192, xn=0x7ffffffe3690, y1=0x7ffffffe3330, Q_xn=5, y2=0x7ffffffe32b0, code=0x7ffffffe33b0, 
    Es_pred=1688, gain_pit=0x7ffffffe32ae, gain_code=0x7ffffffe32a8, gain_inov=0x7ffffffe32a6, norm_gain_code=0x7ffffffe31d8, g_corr=0x7ffffffe3270, clip_gain=0) at lib_enc/gain_enc_fx.c:345
#6  0x00005555557150ca in encod_tran_ivas_fx (st_fx=0x555555ab0ff0, speech_fx=0x7fffffff89d0, Aw_fx=0x7fffffff5e2e, Aq_fx=0x7ffffffe5710, Es_pred_fx=1688, res_fx=0x7ffffffe5210, syn_fx=0x7ffffffe5490, exc_fx=0x7ffffffe5a60, 
    exc2_fx=0x7ffffffe4f90, pitch_buf_fx=0x7ffffffe70a0, voice_factors=0x7ffffffeb4a0, bwe_exc_fx=0x7ffffffe4944, tc_subfr=192, position=240, unbits=0x7ffffffe709c, shift=0, Q_new=6) at lib_enc/enc_tran_fx.c:630
#7  0x00005555556d2ad4 in acelp_core_enc_ivas_fx (st=0x555555ab0ff0, inp=0x7fffffff89d0, A=0x7fffffff60de, Aw=0x7fffffff5e2e, epsP=0x7fffffff5bec, lsp_new=0x7fffffff5af0, lsp_mid=0x7fffffff5a70, vad_hover_flag=0, attack_flag=31, 
    bwe_exc_extended_fx=0x7ffffffe8090, voice_factors_fx=0x7ffffffeb4a0, old_syn_12k8_16k=0x7ffffffe7b90, q_old_syn_12k8_16=0x7ffffffe615a, pitch_buf=0x7ffffffe70a0, unbits=0x7ffffffe709c, hStereoTD=0x0, tdm_lsfQ_PCh=0x7ffffffe7070, Q_new=6)
    at lib_enc/acelp_core_enc_fx.c:1377
#8  0x0000555555750aeb in ivas_core_enc_fx (hSCE=0x555555ab0f90, hCPE=0x0, hMCT=0x0, n_CoreChannels=1, old_inp_12k8_fx=0x7fffffff88d0, old_inp_16k_fx=0x7fffffff7650, Q_new=0x7fffffff61ae, ener_fx=0x7fffffff619c, A_fx=0x7fffffff60de, 
    Aw_fx=0x7fffffff5e2e, epsP_fx=0x7fffffff5bec, epsP_fx_q=0x7fffffff5b1e, lsp_new_fx=0x7fffffff5af0, lsp_mid_fx=0x7fffffff5a70, vad_hover_flag=0x7fffffff5a0e, attack_flag=0x7fffffff5a06, realBuffer_fx=0x7fffffff4b00, 
    imagBuffer_fx=0x7fffffff0f00, q_re_im_buf=0x7ffffffee1fe, old_wsp_fx=0x7ffffffedd20, e_old_wsp=0x7ffffffece9c, loc_harm=0x7ffffffece4e, cor_map_sum_fx=0x7ffffffece46, vad_flag_dtx=0x7ffffffece3e, enerBuffer_fx=0x7ffffffecd40, 
    enerBuffer_fx_exp=0x7ffffffeca6e, fft_buff_fx=0x7ffffffec660, tdm_SM_or_LRTD_Pri=0, ivas_format=3, flag_16k_smc=0) at lib_enc/ivas_core_enc_fx.c:344
#9  0x00005555555a163b in ivas_ism_enc_fx (st_ivas=0x555555a6d2d0, data=0x7fffffff8d70, q_data=11, input_frame=960, nb_bits_metadata=0x7fffffff8e1a, flag_omasa_ener_brate=0) at lib_enc/ivas_ism_enc_fx.c:469
#10 0x0000555555599ddf in ivas_enc_fx (st_ivas=0x555555a6d2d0, data=0x555555ac87e0, n_samples=3840) at lib_enc/ivas_enc_fx.c:212
#11 0x000055555555ef2f in IVAS_ENC_EncodeFrameToSerial (hIvasEnc=0x555555a6d2a0, inputBuffer=0x555555ac87e0, inputBufferSize=3840, outputBitStream=0x7fffffff8f60, numOutBits=0x7fffffff8f5e) at lib_enc/lib_enc_fx.c:1509
#12 0x0000555555559d0c in main (argc=11, argv=0x7fffffffe1c8) at apps/encoder.c:761

This occurs in frame 2773.

Ways to reproduce

IVAS_cod -ism 4 ltvISM1.csv ltvISM2.csv ltvISM3.csv ltvISM4.csv 64000 48 ltv48_4ISM.wav ltv48_4ISM.wav_4_ISM_with_metadata_at_64_kbps_48_kHz_in_48_kHz_out_EXT_out.192