aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-05 19:28:56 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-16 16:00:22 +0200
commite01f02894931767fe98a59fae33375544bfffc92 (patch)
treec6fe70a2d97c8a2a58a97feb6ebccfb5c01e24ff
parentdd907bec361e62265259e999c3bd3ab117dd58db (diff)
downloadffmpeg-e01f02894931767fe98a59fae33375544bfffc92.tar.gz
avcodec/nellymoser: Fix multiple left shift of negative value -8591
Fixes: 1342/clusterfuzz-testcase-minimized-5490842129137664 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 0953736b7e97f6e121a0587a95434bf1857a27da) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/nellymoser.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/nellymoser.c b/libavcodec/nellymoser.c
index 0740c75a0f..d6d5b7a910 100644
--- a/libavcodec/nellymoser.c
+++ b/libavcodec/nellymoser.c
@@ -85,7 +85,7 @@ const int16_t ff_nelly_delta_table[32] = {
static inline int signed_shift(int i, int shift) {
if (shift > 0)
- return i << shift;
+ return (unsigned)i << shift;
return i >> -shift;
}
@@ -109,7 +109,7 @@ static int headroom(int *la)
return 31;
}
l = 30 - av_log2(FFABS(*la));
- *la <<= l;
+ *la *= 1<<l;
return l;
}