Commit 2683d182 authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Crash issue fix

[x] Replaced addition and subtraction basops with saturation to handle
overflow in filter_with_allpass function.
parent 694d8cee
Loading
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -175,11 +175,11 @@ void filter_with_allpass_fx(
        IF( pos == D3_upd )
        D3_upd = -1;

        P1_fx = L_sub( sig[k], Mpy_32_32( g3_fx, D3_fx[pos] ) );
        P2_fx = L_sub( P1_fx, Mpy_32_32( g1_fx, D1_fx[pos] ) );
        P3_fx = L_add( D1_fx[pos], L_sub( Mpy_32_32( g1_fx, P2_fx ), Mpy_32_32( g2_fx, D2_fx[pos] ) ) );
        P4_fx = L_add( D2_fx[pos], Mpy_32_32( g2_fx, P3_fx ) );
        P5_fx = L_add( D3_fx[pos], Mpy_32_32( g3_fx, P1_fx ) );
        P1_fx = L_sub_sat( sig[k], Mpy_32_32( g3_fx, D3_fx[pos] ) );
        P2_fx = L_sub_sat( P1_fx, Mpy_32_32( g1_fx, D1_fx[pos] ) );
        P3_fx = L_add_sat( D1_fx[pos], L_sub( Mpy_32_32( g1_fx, P2_fx ), Mpy_32_32( g2_fx, D2_fx[pos] ) ) );
        P4_fx = L_add_sat( D2_fx[pos], Mpy_32_32( g2_fx, P3_fx ) );
        P5_fx = L_add_sat( D3_fx[pos], Mpy_32_32( g3_fx, P1_fx ) );
        out[k] = P5_fx; /* could overwrite sig */

        D1_fx[( pos + d1 ) & mask] = P2_fx;