diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-06-01 01:07:59 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-06-01 01:07:59 +0000 |
commit | 2453f40602dd6f5fa670954ee733a4155675f645 (patch) | |
tree | 08c017b930676814036db922590dea487a52c348 /libavcodec/mpegaudioenc.c | |
parent | fb2b88a816c020d738753225a4af3928ee75af33 (diff) | |
download | ffmpeg-2453f40602dd6f5fa670954ee733a4155675f645.tar.gz |
Prevent scalefactors from overflowing.
fixes issue351
Originally committed as revision 13591 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpegaudioenc.c')
-rw-r--r-- | libavcodec/mpegaudioenc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpegaudioenc.c b/libavcodec/mpegaudioenc.c index f117d31b79..a67ca213ed 100644 --- a/libavcodec/mpegaudioenc.c +++ b/libavcodec/mpegaudioenc.c @@ -387,7 +387,7 @@ static void compute_scale_factors(unsigned char scale_code[SBLIMIT], vmax = v; } /* compute the scale factor index using log 2 computations */ - if (vmax > 0) { + if (vmax > 1) { n = av_log2(vmax); /* n is the position of the MSB of vmax. now use at most 2 compares to find the index */ |