From 3fc9d7cec4ac4a04e7d60c39beae3be672d3792b Mon Sep 17 00:00:00 2001
From: Aurelien Jacobs <aurel@gnuage.org>
Date: Tue, 9 Sep 2008 11:23:48 +0000
Subject: [PATCH] matroskadec: sanitize track time_scale before using it fix
 issue628

Originally committed as revision 15280 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavformat/matroskadec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index e5242619781..31fc2141734 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1274,6 +1274,8 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
             av_log(matroska->ctx, AV_LOG_INFO,
                    "Unknown/unsupported CodecID %s.\n", track->codec_id);
 
+        if (track->time_scale < 0.01)
+            track->time_scale = 1.0;
         av_set_pts_info(st, 64, matroska->time_scale*track->time_scale, 1000*1000*1000); /* 64 bit pts in ns */
 
         st->codec->codec_id = codec_id;
-- 
GitLab