Commit ef2c943a authored by Sandesh Venkatesh's avatar Sandesh Venkatesh
Browse files

Fix for LTV crash for Stereo stream

[x] Test case - ltv-stereo at 13.2 kbps, 32kHz in, 32kHz out, DTX on, random FER at 5%, bandwidth switching
parent 244fde2f
Loading
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -1029,6 +1029,13 @@ void lp_gain_updt_fx(
#else
    tmp = extract_h( L_shl( norm_gain_code, 3 ) ); /*(16+3)-16 -> Q3*/
#endif
    /* To handle extremely low values */
    test();
    if ( norm_gain_code != 0 && tmp == 0 )
    {
        tmp = 1;
        move16();
    }
    IF( EQ_16( L_frame, L_FRAME ) )
    {
        IF( EQ_16( i_subfr, 0 ) )
@@ -1106,6 +1113,15 @@ void lp_gain_updt_fx(
            move16(); /*Q3*/
        }
    }

    /* To handle extremely low values */
    test();
    if ( tmp != 0 && *lp_gainc == 0 )
    {
        *lp_gainc = 1;
        move16();
    }

    return;
}