[Ffmpeg-cvslog] CVS: ffmpeg/libavformat oggparsetheora.c,1.1,1.2
Måns Rullgård CVS
mru
Fri May 13 00:33:07 CEST 2005
Update of /cvsroot/ffmpeg/ffmpeg/libavformat
In directory mail:/var2/tmp/cvs-serv16407
Modified Files:
oggparsetheora.c
Log Message:
check theora version
Index: oggparsetheora.c
===================================================================
RCS file: /cvsroot/ffmpeg/ffmpeg/libavformat/oggparsetheora.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- oggparsetheora.c 11 May 2005 16:38:34 -0000 1.1
+++ oggparsetheora.c 12 May 2005 22:33:05 -0000 1.2
@@ -43,7 +43,7 @@
int cds = st->codec.extradata_size + os->psize + 2;
uint8_t *cdp;
- if (os->seq > 2)
+ if(!(os->buf[os->pstart] & 0x80))
return 0;
if(!thp){
@@ -56,8 +56,12 @@
init_get_bits(&gb, os->buf + os->pstart, os->psize*8);
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.height = get_bits(&gb, 16) << 4;
@@ -86,8 +90,7 @@
memcpy (cdp, os->buf + os->pstart, os->psize);
st->codec.extradata_size = cds;
-
- return os->seq < 3;
+ return 1;
}
static uint64_t
More information about the ffmpeg-cvslog
mailing list