1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-15 03:15:52 +00:00

1000l: fixed broken handling of the adaption field - part 2

The value of c must be between 0 and 183 inclusive; is c is 0
I can't skip c-1 bytes!


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20503 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
nicodvb 2006-10-29 10:55:02 +00:00
parent 4ea549d06f
commit 891bd61076

View File

@ -2633,14 +2633,24 @@ static int ts_parse(demuxer_t *demuxer , ES_stream_t *es, unsigned char *packet,
int c;
c = stream_read_char(stream);
buf_size--;
if(c < 0 || c > 183) //broken from the stream layer or invalid
{
stream_skip(stream, buf_size-1+junk);
continue;
}
//c==0 is allowed!
if(c > 0)
{
rap_flag = (stream_read_char(stream) & 0x40) >> 6;
buf_size--;
c = min(c-1, buf_size);
c--;
stream_skip(stream, c);
buf_size -= c;
if(buf_size == 0)
continue;
}
}
if(bad)