# HG changeset patch # User michael # Date 1212282479 0 # Node ID 1cf8c883365f1ae5d6f90a2ea5d48bc619869fbe # Parent cdde357b67d8771b078504c74633920e3912c9c3 Prevent scalefactors from overflowing. fixes issue351 diff -r cdde357b67d8 -r 1cf8c883365f mpegaudioenc.c --- 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 */