Commit 636c60c9 authored by Manuel Jander's avatar Manuel Jander
Browse files

Fix crash in fer_energy_fx()

parent c50d44e4
Loading
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -366,10 +366,17 @@ void FEC_encode_ivas_fx(
            /* frame energy (maximum energy per pitch period for voiced frames or mean energy per sample over 2nd halframe for unvoiced frames) */
            /*frame_ener( L_frame, clas, synth, fpit[(L_frame>>6)-1], &enr_q, 0 );*/
            Word32 synth32[L_FRAME16k];
#ifdef NONBE_FIX_ISSUE_2206
            Copy_Scale_sig_16_32_DEPREC( synth, synth32, L_FRAME16k, s_min( 0, Q_synth ) ); /* Qsynth */
#else
            Copy_Scale_sig_16_32_DEPREC( synth, synth32, L_FRAME16k, 0 ); /* Qsynth */
#endif
            fer_energy_fx( L_frame, clas, synth32, Q_synth, shr_r( fpit[( L_frame >> 6 ) - 1], 6 ), &enr_q, L_frame );
#ifdef NONBE_FIX_ISSUE_2206
            exp_enrq = sub( 31, shl( s_max( 0, Q_synth ), 1 ) );
#else
            exp_enrq = sub( 31, shl( Q_synth, 1 ) );

#endif
            test();
            test();
            if ( EQ_16( clas, VOICED_CLAS ) || EQ_16( clas, ONSET ) || EQ_16( clas, SIN_ONSET ) ) /* Voiced or Onset current frame */