1
From 7fb2fe280374bcb1c41c2a8e7aa5632d18dc4279 Mon Sep 17 00:00:00 2001
2
From: reimar <reimar@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
3
Date: Wed, 30 Sep 2009 09:46:48 +0000
4
Subject: [PATCH] Disable parsing for ogg streams where no ogg header was found,
5
if no header was found the parser was not initialized and thus will
6
crash when trying to use it.
8
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@20093 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
10
libavformat/oggdec.c | 5 +++++
11
1 files changed, 5 insertions(+), 0 deletions(-)
13
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
14
index 5d42db7..adf0ad0 100644
15
--- a/libavformat/oggdec.c
16
+++ b/libavformat/oggdec.c
17
@@ -477,12 +477,17 @@ static int
18
ogg_read_header (AVFormatContext * s, AVFormatParameters * ap)
20
struct ogg *ogg = s->priv_data;
23
//linear headers seek from start
24
if (ogg_get_headers (s) < 0){
28
+ for (i = 0; i < ogg->nstreams; i++)
29
+ if (ogg->streams[i].header < 0)
30
+ ogg->streams[i].codec = NULL;
32
//linear granulepos seek from end