summaryrefslogtreecommitdiff
path: root/libavformat/rm.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2005-01-03 02:52:11 +0000
committerMichael Niedermayer <michaelni@gmx.at>2005-01-03 02:52:11 +0000
commit119cebf42965bd28c74c2e99ba16c286c55c76df (patch)
tree66dc0fda1d1eec0a1c9a0198ad09a7e37a58f667 /libavformat/rm.c
parent7c054ea7e2f500e42c0df8c2e6815c3e5bfdebb5 (diff)
skip INDX chunks
Originally committed as revision 3796 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rm.c')
-rw-r--r--libavformat/rm.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/libavformat/rm.c b/libavformat/rm.c
index f08a658219..54ffa028d8 100644
--- a/libavformat/rm.c
+++ b/libavformat/rm.c
@@ -731,6 +731,7 @@ static int sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stream_
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 @@ static int sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stream_
*timestamp = AV_NOPTS_VALUE;
*flags= 0;
}else{
- if(get_byte(pb))
- continue;
- if(get_byte(pb))
- continue;
- len = get_be16(pb);
- if (len < 12)
+ 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=state;
+ state= 0xFFFFFFFF;
+
num = get_be16(pb);
*timestamp = get_be32(pb);
res= get_byte(pb); /* reserved */
@@ -761,6 +769,7 @@ static int sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stream_
break;
}
if (i == s->nb_streams) {
+skip:
/* skip packet if unknown number */
url_fskip(pb, len);
rm->remaining_len -= len;