You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +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:
@@ -216,7 +216,7 @@ static inline int l1_unscale(int n, int mant, int scale_factor)
|
|||||||
shift = scale_factor_modshift[scale_factor];
|
shift = scale_factor_modshift[scale_factor];
|
||||||
mod = shift & 3;
|
mod = shift & 3;
|
||||||
shift >>= 2;
|
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;
|
shift += n;
|
||||||
/* NOTE: at this point, 1 <= shift >= 21 + 15 */
|
/* NOTE: at this point, 1 <= shift >= 21 + 15 */
|
||||||
return (int)((val + (1LL << (shift - 1))) >> shift);
|
return (int)((val + (1LL << (shift - 1))) >> shift);
|
||||||
|
Reference in New Issue
Block a user