aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-02-25 02:19:43 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-23 13:15:16 +0200
commit789da030ff3a3e86adfc4b3d40c8c1a0559d281e (patch)
treef141c50b96cb278947d26001462bbf7733d9de63
parenta560bdeaccd91b3e368342acff4770d874276c4c (diff)
downloadffmpeg-789da030ff3a3e86adfc4b3d40c8c1a0559d281e.tar.gz
avcodec/amrwbdec: Fix 2 runtime errors: left shift of negative value -1
Fixes: 669/clusterfuzz-testcase-4847965409640448 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 6bd79ba59f46a8b3133f28faae53b75540469803) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/amrwbdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index bf668bbd4b..429be71a0d 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -295,7 +295,7 @@ static void decode_pitch_lag_low(int *lag_int, int *lag_frac, int pitch_index,
if (subframe == 0 || (subframe == 2 && mode != MODE_6k60)) {
if (pitch_index < 116) {
*lag_int = (pitch_index + 69) >> 1;
- *lag_frac = (pitch_index - (*lag_int << 1) + 68) << 1;
+ *lag_frac = (pitch_index - (*lag_int << 1) + 68) * 2;
} else {
*lag_int = pitch_index - 24;
*lag_frac = 0;
@@ -305,7 +305,7 @@ static void decode_pitch_lag_low(int *lag_int, int *lag_frac, int pitch_index,
AMRWB_P_DELAY_MIN, AMRWB_P_DELAY_MAX - 15);
} else {
*lag_int = (pitch_index + 1) >> 1;
- *lag_frac = (pitch_index - (*lag_int << 1)) << 1;
+ *lag_frac = (pitch_index - (*lag_int << 1)) * 2;
*lag_int += *base_lag_int;
}
}