diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-10-22 12:48:47 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-10-22 12:48:47 +0200 |
commit | da30d0cec3ebeee65eb939f5da218ac258b0e05e (patch) | |
tree | aa9ede65cab499fc5f46c36f34fb9f4ce6bfba2f /libavcodec/mpegaudio_tablegen.h | |
parent | c68faca68e211d8725fc5a1a88850cc3544e7960 (diff) | |
download | ffmpeg-da30d0cec3ebeee65eb939f5da218ac258b0e05e.tar.gz |
libavcodec/mpegaudio_tablegen: clip value before casting
Avoids FPE on alpha
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpegaudio_tablegen.h')
-rw-r--r-- | libavcodec/mpegaudio_tablegen.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpegaudio_tablegen.h b/libavcodec/mpegaudio_tablegen.h index 789bc2ace8..5592b4aceb 100644 --- a/libavcodec/mpegaudio_tablegen.h +++ b/libavcodec/mpegaudio_tablegen.h @@ -63,7 +63,7 @@ static void mpegaudio_tableinit(void) /* cbrtf() isn't available on all systems, so we use powf(). */ double f = (double)value * pow(value, 1.0 / 3.0) * pow(2, (exponent - 400) * 0.25 + FRAC_BITS + 5) / IMDCT_SCALAR; /* llrint() isn't always available, so round and cast manually. */ - expval_table_fixed[exponent][value] = (long long int) floor(f + 0.5); + expval_table_fixed[exponent][value] = (long long int) FFMIN(floor(f + 0.5), 0xFFFFFFFF); expval_table_float[exponent][value] = f; } exp_table_fixed[exponent] = expval_table_fixed[exponent][1]; |