From: Michael Niedermayer Date: Fri, 5 May 2017 17:28:56 +0000 (+0200) Subject: avcodec/nellymoser: Fix multiple left shift of negative value -8591 X-Git-Tag: n3.4~1746 X-Git-Url: http://git.videolan.org/?p=ffmpeg.git;a=commitdiff_plain;h=0953736b7e97f6e121a0587a95434bf1857a27da 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 --- diff --git a/libavcodec/nellymoser.c b/libavcodec/nellymoser.c index 027726e0ba..5ff6583c5e 100644 --- a/libavcodec/nellymoser.c +++ b/libavcodec/nellymoser.c @@ -84,7 +84,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; } @@ -108,7 +108,7 @@ static int headroom(int *la) return 31; } l = 30 - av_log2(FFABS(*la)); - *la <<= l; + *la *= 1<