diff mbox

[FFmpeg-devel,3/3] avcodec/amrwbdec: Fix runtime error: left shift of negative value -1

Message ID 20170311031125.10925-3-michael@niedermayer.cc
State Accepted
Commit 44e2105189ac66637f34c764febc349238250b1d
Headers show

Commit Message

Michael Niedermayer March 11, 2017, 3:11 a.m. UTC
Fixes: 763/clusterfuzz-testcase-6007567320875008

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavcodec/amrwbdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff --git a/libavcodec/amrwbdec.c b/libavcodec/amrwbdec.c
index 999bfb99dc..57aed874cc 100644
--- a/libavcodec/amrwbdec.c
+++ b/libavcodec/amrwbdec.c
@@ -262,7 +262,7 @@  static void decode_pitch_lag_high(int *lag_int, int *lag_frac, int pitch_index,
             *lag_frac = pitch_index - (*lag_int << 2) + 136;
         } else if (pitch_index < 440) {
             *lag_int  = (pitch_index + 257 - 376) >> 1;
-            *lag_frac = (pitch_index - (*lag_int << 1) + 256 - 376) << 1;
+            *lag_frac = (pitch_index - (*lag_int << 1) + 256 - 376) * 2;
             /* the actual resolution is 1/2 but expressed as 1/4 */
         } else {
             *lag_int  = pitch_index - 280;