oggdec: Recreate streams only in the 1 stream case.

Other cases are not supported and lead to inconsistencies which
can lead to out of array writes.

Reported-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-04-17 14:03:26 +02:00
parent 15141f939d
commit 9bb3b7d028

View File

@ -247,6 +247,9 @@ static int ogg_read_page(AVFormatContext *s, int *str)
if (ogg->headers) {
int n;
if (ogg->nstreams != 1)
return idx;
for (n = 0; n < ogg->nstreams; n++) {
av_freep(&ogg->streams[n].buf);
if (!ogg->state || ogg->state->streams[n].private != ogg->streams[n].private)