diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index 25e41ded3a..41aa051907 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -1409,7 +1409,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) {