diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-05-09 12:45:17 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-05-09 13:17:39 +0200 |
commit | 0be95996d0a07a2f92105da1ed8c13d239c46ad8 (patch) | |
tree | ce333820eea172ff9865375fb215d1a3e62a1871 /libavcodec/mpegaudiodec_template.c | |
parent | 341cacb9ac1bb041d49ddb31fd9671b094ca8a2d (diff) | |
download | ffmpeg-0be95996d0a07a2f92105da1ed8c13d239c46ad8.tar.gz |
avcodec/mpegaudiodec_template: make shift unsigned to avoid undefined behavior
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegaudiodec_template.c')
-rw-r--r-- | libavcodec/mpegaudiodec_template.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpegaudiodec_template.c b/libavcodec/mpegaudiodec_template.c index 1c1ab6e595..6ae34ae2b1 100644 --- a/libavcodec/mpegaudiodec_template.c +++ b/libavcodec/mpegaudiodec_template.c @@ -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); |