summaryrefslogtreecommitdiff
path: root/libavformat/asf.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-01-14 21:50:05 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-01-14 21:50:05 +0000
commit29962fea47d1499cbd3716fcefd0d71b23d1869f (patch)
tree85bbf3848f1d2cbb549c39480fa1f568427f0bf7 /libavformat/asf.c
parent1305a9d55e2b3e0e3e78478548d3c8e0f736d08e (diff)
header parser fix
Originally committed as revision 2707 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/asf.c')
-rw-r--r--libavformat/asf.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/libavformat/asf.c b/libavformat/asf.c
index 6c811ae2c6..cdb3c3e8b4 100644
--- a/libavformat/asf.c
+++ b/libavformat/asf.c
@@ -1062,12 +1062,15 @@ static int asf_get_packet(AVFormatContext *s)
ASFContext *asf = s->priv_data;
ByteIOContext *pb = &s->pb;
uint32_t packet_length, padsize;
- int rsize = 11;
- int c = get_byte(pb);
+ int rsize = 9;
+ int c;
+
+ assert((url_ftell(&s->pb) - s->data_offset) % asf->packet_size == 0);
+
+ c = get_byte(pb);
if (c != 0x82) {
if (!url_feof(pb))
printf("ff asf bad header %x at:%lld\n", c, url_ftell(pb));
- return -EIO;
}
if ((c & 0x0f) == 2) { // always true for now
if (get_le16(pb) != 0) {
@@ -1075,6 +1078,11 @@ static int asf_get_packet(AVFormatContext *s)
printf("ff asf bad non zero\n");
return -EIO;
}
+ rsize+=2;
+/* }else{
+ if (!url_feof(pb))
+ printf("ff asf bad header %x at:%lld\n", c, url_ftell(pb));
+ return -EIO;*/
}
asf->packet_flags = get_byte(pb);