[vlc-commits] commit: Fixed division by 0 with invalid files in avformat wrapper. ( Laurent Aimar )

git at videolan.org git at videolan.org
Thu Apr 15 18:54:44 CEST 2010


vlc/vlc-1.0 | branch: master | Laurent Aimar <fenrir at videolan.org> | Thu Apr 15 19:47:55 2010 +0300| [df8f8ed2b9a6ee43a3db447603bddba5802cb03a] | committer: Rémi Denis-Courmont 

Fixed division by 0 with invalid files in avformat wrapper.

(cherry picked from commit db449895e90d2fd0dbedd7620d174cf70e00ea40)

Conflicts:

	modules/demux/avformat/demux.c

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.0.git/?a=commit;h=df8f8ed2b9a6ee43a3db447603bddba5802cb03a
---

 modules/demux/avformat/demux.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/modules/demux/avformat/demux.c b/modules/demux/avformat/demux.c
index 717f9d9..f50e818 100644
--- a/modules/demux/avformat/demux.c
+++ b/modules/demux/avformat/demux.c
@@ -385,6 +385,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_frame = block_New( p_demux, pkt.size ) ) == NULL )
     {



More information about the vlc-commits mailing list