Commit 0be95996 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mpegaudiodec_template: make shift unsigned to avoid undefined behavior

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 341cacb9
......@@ -216,7 +216,7 @@ static inline int l1_unscale(int n, int mant, int scale_factor)
shift = scale_factor_modshift[scale_factor];
mod = shift & 3;
shift >>= 2;
val = MUL64(mant + (-1 << n) + 1, scale_factor_mult[n-1][mod]);
val = MUL64((int)(mant + (-1U << n) + 1), scale_factor_mult[n-1][mod]);
shift += n;
/* NOTE: at this point, 1 <= shift >= 21 + 15 */
return (int)((val + (1LL << (shift - 1))) >> shift);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment