changeset 5240:432736854b4c libavformat

Disable parsing for ogg streams where no ogg header was found, if no header was found the parser was not initialized and thus will crash when trying to use it.
author reimar
date Wed, 30 Sep 2009 09:46:48 +0000
parents 4d1a325b53cc
children da61aef912cb
files oggdec.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/oggdec.c	Wed Sep 30 09:43:56 2009 +0000
+++ b/oggdec.c	Wed Sep 30 09:46:48 2009 +0000
@@ -477,12 +477,17 @@
 ogg_read_header (AVFormatContext * s, AVFormatParameters * ap)
 {
     struct ogg *ogg = s->priv_data;
+    int i;
     ogg->curidx = -1;
     //linear headers seek from start
     if (ogg_get_headers (s) < 0){
         return -1;
     }
 
+    for (i = 0; i < ogg->nstreams; i++)
+        if (ogg->streams[i].header < 0)
+            ogg->streams[i].codec = NULL;
+
     //linear granulepos seek from end
     ogg_get_length (s);