Currently the ogg vorbis decoder decodes at least one buffer per
scheduler iteration and checks only then if its output queue is already
full. This is bad for several reasons, increased memory footprint is
one of them.
This patch adds an additional check at the beginning of
ogg_post_select() that causes the function to return early if the
output queue is full.
goto out;
if (ret <= 0 && !pod->have_more) /* nothing to do */
goto out;
+ if (btr_get_output_queue_size(btrn) > OGGDEC_MAX_OUTPUT_SIZE)
+ return;
if (!pod->vf) {
if (ret <= 0)
goto out;