Mercurial > libavcodec.hg
diff mpegaudioenc.c @ 6961:1cf8c883365f libavcodec
Prevent scalefactors from overflowing.
fixes issue351
| author | michael |
|---|---|
| date | Sun, 01 Jun 2008 01:07:59 +0000 |
| parents | f2fc71a9c89f |
| children | e943e1409077 |
line wrap: on
line diff
--- a/mpegaudioenc.c Sat May 31 22:12:49 2008 +0000 +++ b/mpegaudioenc.c Sun Jun 01 01:07:59 2008 +0000 @@ -387,7 +387,7 @@ 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 */
