mirror of
https://git.videolan.org/git/ffmpeg.git
synced 2024-09-10 09:31:06 +02:00
avcodec/mpegaudiodec_template: make shift unsigned to avoid undefined behavior
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
341cacb9ac
commit
0be95996d0
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user