aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-26 21:56:03 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2020-01-06 11:30:43 +0100
commitf860df25cca44957c5c600f912d154bda294be39 (patch)
tree63a545edd5dca15be8ad3fd79dd43fc048b7f874
parent56d708c57f1fd4e2582fae98e86b221de67ed321 (diff)
downloadffmpeg-f860df25cca44957c5c600f912d154bda294be39.tar.gz
avcodec/g723_1dec: fix invalid shift with negative sid_gain
Fixes: left shift of negative value -1 Fixes: 18395/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_G723_1_fuzzer-5710313034350592 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 1850c3feaa1c7b5b63a55c61075029fa59c84e66) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/g723_1dec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/g723_1dec.c b/libavcodec/g723_1dec.c
index f92eb76ba0..d5a8e19f05 100644
--- a/libavcodec/g723_1dec.c
+++ b/libavcodec/g723_1dec.c
@@ -667,7 +667,7 @@ static int estimate_sid_gain(G723_1_Context *p)
if (p->sid_gain < 0) t = INT32_MIN;
else t = INT32_MAX;
} else
- t = p->sid_gain << shift;
+ t = p->sid_gain * (1 << shift);
} else if(shift < -31) {
t = (p->sid_gain < 0) ? -1 : 0;
}else