diff options
author | Justin Ruggles <justin.ruggles@gmail.com> | 2011-04-15 23:18:33 -0400 |
---|---|---|
committer | Justin Ruggles <justin.ruggles@gmail.com> | 2011-05-01 13:32:04 -0400 |
commit | 63b1866ae1e19ff0d694746a84e2eac859cda462 (patch) | |
tree | 085516f380a0ec51a6c2be879c3fd0f601ac7993 /libavcodec | |
parent | 177fed4e9baa43bdcfb6771195eb85f19412c23e (diff) | |
download | ffmpeg-63b1866ae1e19ff0d694746a84e2eac859cda462.tar.gz |
ac3enc: clip large coefficient values and negative exponents rather than using
av_assert2().
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/ac3dsp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/ac3dsp.c b/libavcodec/ac3dsp.c index dccad3b3e8..e3ca37ebdd 100644 --- a/libavcodec/ac3dsp.c +++ b/libavcodec/ac3dsp.c @@ -164,8 +164,10 @@ static void ac3_extract_exponents_c(uint8_t *exp, int32_t *coef, int nb_coefs) if (e >= 24) { e = 24; coef[i] = 0; + } else if (e < 0) { + e = 0; + coef[i] = av_clip(coef[i], -16777215, 16777215); } - av_assert2(e >= 0); } exp[i] = e; } |