oggparseskeleton: avoid header parsing failure
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 6 Jul 2013 21:53:19 +0000 (23:53 +0200)
committerJames Almer <jamrial@gmail.com>
Mon, 8 Jul 2013 00:42:01 +0000 (21:42 -0300)
Based on description by James Almer and the xiph wiki

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 9a6e814be7c052deb34a8f585176d053f4c187c1)

libavformat/oggparseskeleton.c

index b012105..d94b0c2 100644 (file)
@@ -37,6 +37,9 @@ static int skeleton_header(AVFormatContext *s, int idx)
     strcpy(st->codec->codec_name, "skeleton");
     st->codec->codec_type = AVMEDIA_TYPE_DATA;
 
+    if ((os->flags & OGG_FLAG_EOS) && os->psize == 0)
+        return 1;
+
     if (os->psize < 8)
         return -1;