aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-07-07 00:03:51 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-14 23:30:38 +0100
commit428dee1a0357203dab107f3769485013d886f9ad (patch)
treec501986ab3acd426a7b93d02bd4d687ae3247fa6
parent71fd0201974023137bb74207846638fde5e4ed80 (diff)
downloadffmpeg-428dee1a0357203dab107f3769485013d886f9ad.tar.gz
avcodec/alsdec: fix undefined shift in multiply()
Fixes: left shift of negative value -6 Fixes: 15564/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ALS_fuzzer-5701655938465792 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 b880b3b236ddd00f85ea502b4c17a145fd26c790) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/alsdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 7388dded19..bd7049d28a 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1421,7 +1421,7 @@ static SoftFloat_IEEE754 multiply(SoftFloat_IEEE754 a, SoftFloat_IEEE754 b) {
return_val = 0x80000000U;
}
- return_val |= (a.exp + b.exp + bit_count - 47) << 23;
+ return_val |= ((unsigned)av_clip(a.exp + b.exp + bit_count - 47, -126, 127) << 23) & 0x7F800000;
return_val |= mantissa;
return av_bits2sf_ieee754(return_val);
}