diff options
Diffstat (limited to 'libavformat/oggparsetheora.c')
-rw-r--r-- | libavformat/oggparsetheora.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libavformat/oggparsetheora.c b/libavformat/oggparsetheora.c index 4810357d03..6bea4ec2a8 100644 --- a/libavformat/oggparsetheora.c +++ b/libavformat/oggparsetheora.c @@ -53,7 +53,8 @@ theora_header (AVFormatContext * s, int idx) os->private = thp; } - if (os->buf[os->pstart] == 0x80) { + switch (os->buf[os->pstart]) { + case 0x80: { GetBitContext gb; int width, height; AVRational timebase; @@ -109,9 +110,16 @@ theora_header (AVFormatContext * s, int idx) st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = AV_CODEC_ID_THEORA; st->need_parsing = AVSTREAM_PARSE_HEADERS; - - } else if (os->buf[os->pstart] == 0x81) { - ff_vorbis_comment (s, &st->metadata, os->buf + os->pstart + 7, os->psize - 8); + } + break; + case 0x81: + ff_vorbis_comment(s, &st->metadata, os->buf + os->pstart + 7, os->psize - 8); + case 0x82: + if (!thp->version) + return -1; + break; + default: + return -1; } st->codec->extradata = av_realloc (st->codec->extradata, |