Commit 0336dea2 authored by Luca Barbato's avatar Luca Barbato

oggparsetheora: make it more robust

parent bb146bb5
...@@ -53,7 +53,8 @@ theora_header (AVFormatContext * s, int idx) ...@@ -53,7 +53,8 @@ theora_header (AVFormatContext * s, int idx)
os->private = thp; os->private = thp;
} }
if (os->buf[os->pstart] == 0x80) { switch (os->buf[os->pstart]) {
case 0x80: {
GetBitContext gb; GetBitContext gb;
int width, height; int width, height;
AVRational timebase; AVRational timebase;
...@@ -110,8 +111,16 @@ theora_header (AVFormatContext * s, int idx) ...@@ -110,8 +111,16 @@ theora_header (AVFormatContext * s, int idx)
st->codec->codec_id = AV_CODEC_ID_THEORA; st->codec->codec_id = AV_CODEC_ID_THEORA;
st->need_parsing = AVSTREAM_PARSE_HEADERS; st->need_parsing = AVSTREAM_PARSE_HEADERS;
} else if (os->buf[os->pstart] == 0x83) { }
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, st->codec->extradata = av_realloc (st->codec->extradata,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment