changeset 6016:ce535a7152ef libavformat

matroskadec: Ensure time_scale is nonzero, fixes divide-by-zero if the file has 0 written Based on a Chromium patch
author conrad
date Tue, 18 May 2010 21:21:28 +0000
parents 8986c1d43cb2
children 9565f0ce6f2e
files matroskadec.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/matroskadec.c	Tue May 18 21:21:23 2010 +0000
+++ b/matroskadec.c	Tue May 18 21:21:28 2010 +0000
@@ -1154,6 +1154,8 @@
         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;