summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/alsdec.c6
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) {