[FFmpeg-cvslog] r23167 - trunk/libavformat/matroskadec.c

conrad subversion
Tue May 18 23:21:28 CEST 2010


Author: conrad
Date: Tue May 18 23:21:28 2010
New Revision: 23167

Log:
matroskadec: Ensure time_scale is nonzero, fixes divide-by-zero if the file
has 0 written

Based on a Chromium patch

Modified:
   trunk/libavformat/matroskadec.c

Modified: trunk/libavformat/matroskadec.c
==============================================================================
--- trunk/libavformat/matroskadec.c	Tue May 18 23:21:23 2010	(r23166)
+++ trunk/libavformat/matroskadec.c	Tue May 18 23:21:28 2010	(r23167)
@@ -1154,6 +1154,8 @@ static int matroska_read_header(AVFormat
         return -1;
     matroska_execute_seekhead(matroska);
 
+    if (!matroska->time_scale)
+        matroska->time_scale = 1000000;
     if (matroska->duration)
         matroska->ctx->duration = matroska->duration * matroska->time_scale
                                   * 1000 / AV_TIME_BASE;



More information about the ffmpeg-cvslog mailing list