skip INDX chunks
Originally committed as revision 3796 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
7c054ea7e2
commit
119cebf429
@ -731,6 +731,7 @@ static int sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stream_
|
|||||||
ByteIOContext *pb = &s->pb;
|
ByteIOContext *pb = &s->pb;
|
||||||
int len, num, res, i;
|
int len, num, res, i;
|
||||||
AVStream *st;
|
AVStream *st;
|
||||||
|
uint32_t state=0xFFFFFFFF;
|
||||||
|
|
||||||
while(!url_feof(pb)){
|
while(!url_feof(pb)){
|
||||||
*pos= url_ftell(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;
|
*timestamp = AV_NOPTS_VALUE;
|
||||||
*flags= 0;
|
*flags= 0;
|
||||||
}else{
|
}else{
|
||||||
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;
|
continue;
|
||||||
if(get_byte(pb))
|
goto skip;
|
||||||
continue;
|
}
|
||||||
len = get_be16(pb);
|
|
||||||
if (len < 12)
|
if(state > (unsigned)0xFFFF || state < 12)
|
||||||
continue;
|
continue;
|
||||||
|
len=state;
|
||||||
|
state= 0xFFFFFFFF;
|
||||||
|
|
||||||
num = get_be16(pb);
|
num = get_be16(pb);
|
||||||
*timestamp = get_be32(pb);
|
*timestamp = get_be32(pb);
|
||||||
res= get_byte(pb); /* reserved */
|
res= get_byte(pb); /* reserved */
|
||||||
@ -761,6 +769,7 @@ static int sync(AVFormatContext *s, int64_t *timestamp, int *flags, int *stream_
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (i == s->nb_streams) {
|
if (i == s->nb_streams) {
|
||||||
|
skip:
|
||||||
/* skip packet if unknown number */
|
/* skip packet if unknown number */
|
||||||
url_fskip(pb, len);
|
url_fskip(pb, len);
|
||||||
rm->remaining_len -= len;
|
rm->remaining_len -= len;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user