ogg: relax demuxer conformance checks
authorLuca Barbato <lu_zero@gentoo.org>
Thu, 20 Jun 2013 09:36:04 +0000 (11:36 +0200)
committerLuca Barbato <lu_zero@gentoo.org>
Sat, 22 Jun 2013 18:54:59 +0000 (20:54 +0200)
Some samples in the wild are missing headers that are expected by the
specification but in practice do not affect decoding.

libavformat/oggdec.c

index d8f89b8..2ab7301 100644 (file)
@@ -478,8 +478,11 @@ static int ogg_get_headers(AVFormatContext *s)
         if (os->codec && os->codec->nb_header &&
             os->nb_header < os->codec->nb_header) {
             av_log(s, AV_LOG_ERROR,
-                   "Headers mismatch for stream %d\n", i);
-            return AVERROR_INVALIDDATA;
+                   "Headers mismatch for stream %d: "
+                   "expected %d received %d.\n",
+                   i, os->codec->nb_header, os->nb_header);
+            if (s->error_recognition & AV_EF_EXPLODE)
+                return AVERROR_INVALIDDATA;
         }
         if (os->start_granule != OGG_NOGRANULE_VALUE)
             os->lastpts = s->streams[i]->start_time =