]> git.sesse.net Git - vlc/commitdiff
demux: mkv: ensure timescale is always valid
authorFrancois Cartegnie <fcvlcdev@free.fr>
Thu, 13 Mar 2014 22:47:27 +0000 (23:47 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Thu, 13 Mar 2014 22:59:29 +0000 (23:59 +0100)
modules/demux/mkv/matroska_segment_parse.cpp

index 4e3ac8fa2a2232e84bf293287eb3964e288b0a15..41fa0f30b35cbcc09e270920f4820126f935ca2c 100644 (file)
@@ -341,6 +341,7 @@ void matroska_segment_c::ParseTrackEntry( KaxTrackEntry *m )
             KaxTrackTimecodeScale &ttcs = *(KaxTrackTimecodeScale*)l;
 
             tk->f_timecodescale = float( ttcs );
+            if ( tk->f_timecodescale <= 0 ) tk->f_timecodescale = 1.0;
             msg_Dbg( &sys.demuxer, "|   |   |   + Track TimeCodeScale=%f", tk->f_timecodescale );
         }
         else  if( MKV_IS_ID( l, KaxMaxBlockAdditionID ) ) // UNUSED