oggdec: Recreate streams only in the 1 stream case.
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Apr 2012 12:03:26 +0000 (14:03 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 17 Apr 2012 12:03:26 +0000 (14:03 +0200)
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>
libavformat/oggdec.c

index bdd2c5b..ab52379 100644 (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)