mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-28 12:32:17 +02:00
check theora version
Originally committed as revision 4229 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
5085d59ddc
commit
5b558574ba
@ -43,7 +43,7 @@ theora_header (AVFormatContext * s, int idx)
|
|||||||
int cds = st->codec.extradata_size + os->psize + 2;
|
int cds = st->codec.extradata_size + os->psize + 2;
|
||||||
uint8_t *cdp;
|
uint8_t *cdp;
|
||||||
|
|
||||||
if (os->seq > 2)
|
if(!(os->buf[os->pstart] & 0x80))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if(!thp){
|
if(!thp){
|
||||||
@ -56,8 +56,12 @@ theora_header (AVFormatContext * s, int idx)
|
|||||||
init_get_bits(&gb, os->buf + os->pstart, os->psize*8);
|
init_get_bits(&gb, os->buf + os->pstart, os->psize*8);
|
||||||
|
|
||||||
skip_bits(&gb, 7*8); /* 0x80"theora" */
|
skip_bits(&gb, 7*8); /* 0x80"theora" */
|
||||||
skip_bits(&gb, 3*8);
|
if(get_bits(&gb, 8) != 3) /* major version */
|
||||||
|
return -1;
|
||||||
|
if(get_bits(&gb, 8) != 2) /* minor version */
|
||||||
|
return -1;
|
||||||
|
skip_bits(&gb, 8); /* revision */
|
||||||
|
|
||||||
st->codec.width = get_bits(&gb, 16) << 4;
|
st->codec.width = get_bits(&gb, 16) << 4;
|
||||||
st->codec.height = get_bits(&gb, 16) << 4;
|
st->codec.height = get_bits(&gb, 16) << 4;
|
||||||
|
|
||||||
@ -86,8 +90,7 @@ theora_header (AVFormatContext * s, int idx)
|
|||||||
memcpy (cdp, os->buf + os->pstart, os->psize);
|
memcpy (cdp, os->buf + os->pstart, os->psize);
|
||||||
st->codec.extradata_size = cds;
|
st->codec.extradata_size = cds;
|
||||||
|
|
||||||
|
return 1;
|
||||||
return os->seq < 3;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint64_t
|
static uint64_t
|
||||||
|
Loading…
x
Reference in New Issue
Block a user