Mercurial > libavformat.hg
changeset 632:9f8fa2f4edfd libavformat
skip INDX chunks
author | michael |
---|---|
date | Mon, 03 Jan 2005 02:52:11 +0000 |
parents | 07f51a0f6599 |
children | aff6e233426a |
files | rm.c |
diffstat | 1 files changed, 15 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/rm.c Sat Jan 01 23:02:09 2005 +0000 +++ b/rm.c Mon Jan 03 02:52:11 2005 +0000 @@ -731,6 +731,7 @@ ByteIOContext *pb = &s->pb; int len, num, res, i; AVStream *st; + uint32_t state=0xFFFFFFFF; while(!url_feof(pb)){ *pos= url_ftell(pb); @@ -740,13 +741,20 @@ *timestamp = AV_NOPTS_VALUE; *flags= 0; }else{ - if(get_byte(pb)) - continue; - if(get_byte(pb)) + state= (state<<8) + get_byte(pb); + + if(state == MKBETAG('I', 'N', 'D', 'X')){ + len = get_be16(pb) - 6; + if(len<0) + continue; + goto skip; + } + + if(state > (unsigned)0xFFFF || state < 12) continue; - len = get_be16(pb); - if (len < 12) - continue; + len=state; + state= 0xFFFFFFFF; + num = get_be16(pb); *timestamp = get_be32(pb); res= get_byte(pb); /* reserved */ @@ -761,6 +769,7 @@ break; } if (i == s->nb_streams) { +skip: /* skip packet if unknown number */ url_fskip(pb, len); rm->remaining_len -= len;