aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-06-20 19:09:11 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-14 23:30:37 +0100
commit55fca6e6e5ec63565ecce4d3447ccd814aced9b5 (patch)
treed9735673da8bb0322020fec1fa26e525f6b010c0
parentfb81fd52d35565439592cd616c5680601a137cf9 (diff)
downloadffmpeg-55fca6e6e5ec63565ecce4d3447ccd814aced9b5.tar.gz
avcodec/alsdec: Fix invalid shift in multiply()
Fixes: shift exponent -24 is negative Fixes: 15292/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5768533318828032 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 f30be1ec9856551d96f3876eec5f8b8abf456b81) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/alsdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 13bd52f297..6805a8d694 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1384,6 +1384,9 @@ static SoftFloat_IEEE754 multiply(SoftFloat_IEEE754 a, SoftFloat_IEEE754 b) {
mantissa_temp = (uint64_t)a.mant * (uint64_t)b.mant;
mask_64 = (uint64_t)0x1 << 47;
+ if (!mantissa_temp)
+ return FLOAT_0;
+
// Count the valid bit count
while (!(mantissa_temp & mask_64) && mask_64) {
bit_count--;