Index: lib/enc/encoder_toplevel.c =================================================================== --- lib/enc/encoder_toplevel.c (revision 15558) +++ lib/enc/encoder_toplevel.c (working copy) @@ -705,7 +705,7 @@ /* Calculate the Q Modifier step size required to cause a step down from full target bandwidth to 40% of target between max Q and best Q */ - QModStep = 0.5 / (double)((Q_TABLE_SIZE - 1) - + QModStep = 0.5 / (double)((Q_TABLE_SIZE) - cpi->Configuration.ActiveMaxQ); /* Set up the cpi->QTargetModifier[] table. */ @@ -755,6 +755,9 @@ Configuration.TargetBandwidth)) * 0.0175) )); } + if (cpi->ThisFrameTargetBytes <= 0) + cpi->ThisFrameTargetBytes = 1; + if ( !DropFrame ) { /* pick all the macroblock modes and motion vectors */ ogg_uint32_t InterError;