mirror of
https://github.com/mpv-player/mpv
synced 2025-01-04 14:12:10 +00:00
Move boundary check before use!
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24475 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
b7f2c746cc
commit
4e9311b1de
@ -197,6 +197,10 @@ static int ty_tmf_filetoparts( demuxer_t *demux, TiVoInfo *tivo )
|
||||
|
||||
if ( isty )
|
||||
{
|
||||
if ( parts >= MAX_TMF_PARTS ) {
|
||||
mp_msg( MSGT_DEMUX, MSGL_ERR, "ty:tmf too big\n" );
|
||||
break;
|
||||
}
|
||||
tivo->tmfparts[ parts ].fileNo = parts;
|
||||
tivo->tmfparts[ parts ].fileSize = size;
|
||||
tivo->tmfparts[ parts ].startOffset = offset + 512;
|
||||
@ -222,8 +226,6 @@ static int ty_tmf_filetoparts( demuxer_t *demux, TiVoInfo *tivo )
|
||||
tivo->tmfparts[ parts ].startOffset
|
||||
);
|
||||
parts++;
|
||||
if ( parts > MAX_TMF_PARTS )
|
||||
mp_msg( MSGT_DEMUX, MSGL_ERR, "ty:tmf too big\n" );
|
||||
}
|
||||
|
||||
if ( ( offset + skip ) > totalsize )
|
||||
|
Loading…
Reference in New Issue
Block a user