[vlc-devel] commit: Fixed invalid report of broken avi index. (Laurent Aimar )
git version control
git at videolan.org
Tue Sep 29 21:07:47 CEST 2009
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Tue Sep 29 21:04:13 2009 +0200| [a2671feb378ec308e42a0e50ce9bfc41262baf9c] | committer: 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.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a2671feb378ec308e42a0e50ce9bfc41262baf9c
---
modules/demux/avi/avi.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 2d5de5c..85db883 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -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 )
{
More information about the vlc-devel
mailing list