# HG changeset patch # User michael # Date 1074117005 0 # Node ID 0778b93924cb747d0ac31e9098cae4f57a5e31e3 # Parent c5ea5cdb5b58676f8110aba23afb0812af65d050 header parser fix diff -r c5ea5cdb5b58 -r 0778b93924cb asf.c --- a/asf.c Wed Jan 14 21:27:59 2004 +0000 +++ b/asf.c Wed Jan 14 21:50:05 2004 +0000 @@ -1062,12 +1062,15 @@ 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 @@ 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);