[FFmpeg-cvslog] r21708 - in branches/0.5: . libavformat/oggdec.c

siretart subversion
Tue Feb 9 19:24:30 CET 2010


Author: siretart
Date: Tue Feb  9 19:24:30 2010
New Revision: 21708

Log:
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.

Modified:
   branches/0.5/   (props changed)
   branches/0.5/libavformat/oggdec.c

Modified: branches/0.5/libavformat/oggdec.c
==============================================================================
--- branches/0.5/libavformat/oggdec.c	Tue Feb  9 19:10:07 2010	(r21707)
+++ branches/0.5/libavformat/oggdec.c	Tue Feb  9 19:24:30 2010	(r21708)
@@ -477,12 +477,17 @@ static int
 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);
 



More information about the ffmpeg-cvslog mailing list