changeset 353:0778b93924cb libavformat

header parser fix
author michael
date Wed, 14 Jan 2004 21:50:05 +0000
parents c5ea5cdb5b58
children 6770ca07abe2
files asf.c
diffstat 1 files changed, 11 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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);