diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-03-11 16:28:06 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-03-11 16:29:40 +0100 |
commit | 8c7a0932abeeabd86688b2cb495daa61c7fc19be (patch) | |
tree | 7e0c848f8769a1bf479e5337386c4bbe5b2ad835 /libavcodec/amrnbdec.c | |
parent | fa74058dd36413aaa24c7e5982c66882d9dda6c1 (diff) | |
download | ffmpeg-8c7a0932abeeabd86688b2cb495daa61c7fc19be.tar.gz |
avcodec/amrnbde: Fix undefined shift in decode_pitch_vector()
This also simplifies the code
Found-by: Clang -fsanitize=shift
Reported-by: Thierry Foucu <tfoucu@google.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/amrnbdec.c')
-rw-r--r-- | libavcodec/amrnbdec.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c index 43ddb625eb..3fa639de27 100644 --- a/libavcodec/amrnbdec.c +++ b/libavcodec/amrnbdec.c @@ -399,17 +399,17 @@ static void decode_pitch_vector(AMRContext *p, decode_pitch_lag_1_6(&pitch_lag_int, &pitch_lag_frac, amr_subframe->p_lag, p->pitch_lag_int, subframe); - } else + } else { ff_decode_pitch_lag(&pitch_lag_int, &pitch_lag_frac, amr_subframe->p_lag, p->pitch_lag_int, subframe, mode != MODE_4k75 && mode != MODE_5k15, mode <= MODE_6k7 ? 4 : (mode == MODE_7k95 ? 5 : 6)); + pitch_lag_frac *= 2; + } p->pitch_lag_int = pitch_lag_int; // store previous lag in a uint8_t - pitch_lag_frac <<= (p->cur_frame_mode != MODE_12k2); - pitch_lag_int += pitch_lag_frac > 0; /* Calculate the pitch vector by interpolating the past excitation at the |