Commit fe1a3b8e authored by Felicia Lim's avatar Felicia Lim Committed by Commit Bot

Saturate add to avoid int overflow.

Bug: 842528
Change-Id: Ic19806411dd784bf820a27a65abb1b6bb14517cc
Reviewed-on: https://chromium-review.googlesource.com/1072869Reviewed-by: default avatarHenrik Andreasson <henrika@chromium.org>
Commit-Queue: Felicia Lim <flim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561908}
parent fffc1827
......@@ -18,3 +18,5 @@ Local changes:
* Apply https://github.com/xiph/opus/pull/73
* Apply https://github.com/xiph/opus/pull/87
* Make sure HB_gain is not NaN in an attempt to fix chromium:826914
* Saturate add to avoid int overflow to fix chromium:842528. This should be
reverted when updating to v1.3
......@@ -394,7 +394,7 @@ static OPUS_INLINE void silk_noise_shape_quantizer_del_dec(
/* Long-term shaping */
if( lag > 0 ) {
/* Symmetric, packed FIR coefficients */
n_LTP_Q14 = silk_SMULWB( silk_ADD32( shp_lag_ptr[ 0 ], shp_lag_ptr[ -2 ] ), HarmShapeFIRPacked_Q14 );
n_LTP_Q14 = silk_SMULWB( silk_ADD_SAT32( shp_lag_ptr[ 0 ], shp_lag_ptr[ -2 ] ), HarmShapeFIRPacked_Q14 );
n_LTP_Q14 = silk_SMLAWT( n_LTP_Q14, shp_lag_ptr[ -1 ], HarmShapeFIRPacked_Q14 );
n_LTP_Q14 = silk_SUB_LSHIFT32( LTP_pred_Q14, n_LTP_Q14, 2 ); /* Q12 -> Q14 */
shp_lag_ptr++;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment