]> git.sesse.net Git - vlc/commitdiff
Fixed division by 0 with invalid files in avformat wrapper.
authorLaurent Aimar <fenrir@videolan.org>
Tue, 23 Feb 2010 21:50:19 +0000 (22:50 +0100)
committerLaurent Aimar <fenrir@videolan.org>
Tue, 23 Feb 2010 23:11:48 +0000 (00:11 +0100)
modules/demux/avformat/demux.c

index c407813bc57035e28130ebea02c73ae6427e1509..9472b5d90d73d7f02509ac41cf13c20341f17f40 100644 (file)
@@ -498,6 +498,12 @@ static int Demux( demux_t *p_demux )
         return 1;
     }
     const AVStream *p_stream = p_sys->ic->streams[pkt.stream_index];
+    if( p_stream->time_base.den <= 0 )
+    {
+        msg_Warn( p_demux, "Invalid time base for the stream %d", pkt.stream_index );
+        av_free_packet( &pkt );
+        return 1;
+    }
     if( p_stream->codec->codec_id == CODEC_ID_SSA )
     {
         p_frame = BuildSsaFrame( &pkt, p_sys->i_ssa_order++ );