Commit d27a3f1f authored by Tapani Pihlajakuja's avatar Tapani Pihlajakuja
Browse files

Avoid div by zero

parent 6c6d6683
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2820,7 +2820,7 @@ void protoSignalComputation2_fx(
        ELSE
        {
            /* Add EPSILON in proper Q */
            Word32 eps_fx = L_shr( 0x40000000, sub( 80, stereo_type_detect->q_total_hi_power ) ); /* EPSILON in Q(q_total_hi_power) */
            Word32 eps_fx = L_max( L_shr( 0x40000000, sub( 80, stereo_type_detect->q_total_hi_power ) ), 1 ); /* EPSILON in Q(q_total_hi_power), min 1 to avoid div by zero */
            denom_fx = L_add_sat( stereo_type_detect->total_hi_power_fx, eps_fx );
            q_denom = stereo_type_detect->q_total_hi_power;
        }