diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-07-26 17:07:01 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-11-11 20:18:47 +0100 |
commit | 2588a10aa650db442ad4e0f9a5b40081194ae5dc (patch) | |
tree | d8dcb2c0c7c35deec44d348575103975741386ea /libavcodec/alsdec.c | |
parent | 336a864f27dcbd93ad712f7139b41b5fd305766b (diff) | |
download | ffmpeg-2588a10aa650db442ad4e0f9a5b40081194ae5dc.tar.gz |
avcodec/alsdec: fix mantisse shift
Fixes: shift exponent -1 is negative
Fixes: 16039/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5656825657032704
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 02346292a334a51f6da802146b782bdb01ae9b4e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/alsdec.c')
-rw-r--r-- | libavcodec/alsdec.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index d4451482a4..e1449a72a5 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -1404,7 +1404,11 @@ static SoftFloat_IEEE754 multiply(SoftFloat_IEEE754 a, SoftFloat_IEEE754 b) { } } - mantissa = (unsigned int)(mantissa_temp >> cutoff_bit_count); + if (cutoff_bit_count >= 0) { + mantissa = (unsigned int)(mantissa_temp >> cutoff_bit_count); + } else { + mantissa = (unsigned int)(mantissa_temp <<-cutoff_bit_count); + } // Need one more shift? if (mantissa & 0x01000000ul) { |