Commit a2671feb authored by Laurent Aimar's avatar Laurent Aimar

Fixed invalid report of broken avi index.

AVI demuxer now also check the number of frames from the index and the
avi header.

Thanks MSJ for the report on the forum.
parent fa9df363
......@@ -673,7 +673,18 @@ aviindex:
/* *** movie length in sec *** */
p_sys->i_length = AVI_MovieGetLength( p_demux );
if( p_sys->i_length < (mtime_t)p_avih->i_totalframes *
/* Check the index completeness */
unsigned int i_idx_totalframes = 0;
for( unsigned int i = 0; i < p_sys->i_track; i++ )
{
const avi_track_t *tk = p_sys->track[i];
if( tk->i_cat == VIDEO_ES && tk->p_index )
i_idx_totalframes = __MAX(i_idx_totalframes, tk->i_idxnb);
continue;
}
if( i_idx_totalframes != p_avih->i_totalframes &&
p_sys->i_length < (mtime_t)p_avih->i_totalframes *
(mtime_t)p_avih->i_microsecperframe /
(mtime_t)1000000 )
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment