bm->avg_binacc is not initialized with zeros, resulting in too large ogg files when encodign with fixed bitrate settings
Within the bitrate.c file, the array bm->avg_binacc is allocated (with
ogg_malloc) but is not initialized. A malloc does not have to initialize
the allocated memory chunk with zero's (it might be compiler dependent
though). The behaviour that's observed is that resulting file will be way too
large when trying to encode with a fixed bitrate (bitrate is increasing
(drifting) during the encoding process. The solution is to add a the following
line just after the ogg_malloc:
(void)memset( bm->avg_binacc, 0,bins*sizeof(*bm->avg_binacc) );
But this problem might be at more places in the code and are very hard to
track down. So it might be well worth to redirect the ogg_malloc function to a
calloc function (which is guarenteed to initialize the allocated memory chunk
with zero's)