aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/lagarith.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-10 00:50:05 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-20 03:41:33 +0200
commit5380abf7854fef03925df81ed7d172cee5be4572 (patch)
treeccc5857022238cbacdcc49d407f90cd2f0d461a4 /libavcodec/lagarith.c
parentdb3d3ced152dddba44f7da2d063e23bfa991de9d (diff)
downloadffmpeg-5380abf7854fef03925df81ed7d172cee5be4572.tar.gz
avcodec/lagarith: Fix runtime error: left shift of negative value -1
Fixes: 1424/clusterfuzz-testcase-minimized-6088327159611392 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 ddb2dd7edbccc5596d8e3c039133be8444cb1d02) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/lagarith.c')
-rw-r--r--libavcodec/lagarith.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/lagarith.c b/libavcodec/lagarith.c
index 94d723d319..a8d5cef83e 100644
--- a/libavcodec/lagarith.c
+++ b/libavcodec/lagarith.c
@@ -98,7 +98,7 @@ static uint32_t softfloat_mul(uint32_t x, uint64_t mantissa)
static uint8_t lag_calc_zero_run(int8_t x)
{
- return (x << 1) ^ (x >> 7);
+ return (x * 2) ^ (x >> 7);
}
static int lag_decode_prob(GetBitContext *gb, uint32_t *value)