Commit 1fd7e6ad authored by Manuel Jander's avatar Manuel Jander
Browse files

Improve scale of new_inp_resamp16k_fx to avoid crash.

parent 37aefba1
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -233,7 +233,11 @@ ivas_error pre_proc_front_ivas_fx(

    Word16 Q_min = add( sub( 15, st->exp_old_inp_12k8 ), norm_arr( st->old_inp_12k8_fx, L_INP_MEM ) );
    Word16 input_frame_full = shl( input_frame, 1 ); //(old frame input length + new frame input length)
#ifdef NONBE_FIX_ISSUE_2206
    Q_min = s_min( Q_min, sub( add( L_norm_arr( st->input32_fx - input_frame, input_frame_full ), st->q_inp32 ), 16 ) );
#else
    Q_min = s_min( Q_min, sub( add( getScaleFactor32( st->input32_fx - input_frame, input_frame_full ), st->q_inp32 ), 16 ) );
#endif
    Q_min = s_max( -2, Q_min );
    Copy_Scale_sig_32_16( st->input32_fx - input_frame, st->input_fx - input_frame, input_frame_full, sub( Q_min, st->q_inp32 ) ); // Q_min
    st->q_inp = Q_min;