diff options
author | David Conrad <lessen42@gmail.com> | 2010-05-18 21:21:28 +0000 |
---|---|---|
committer | David Conrad <lessen42@gmail.com> | 2010-05-18 21:21:28 +0000 |
commit | d98bd80ed3ac2c7274654247daa7b821e2ed6478 (patch) | |
tree | 0db69906a295cb928f1b81681416dc9074478576 /libavformat/matroskadec.c | |
parent | 1c664b239cb583868c41cc04ceee38b02aa4caf5 (diff) | |
download | ffmpeg-d98bd80ed3ac2c7274654247daa7b821e2ed6478.tar.gz |
matroskadec: Ensure time_scale is nonzero, fixes divide-by-zero if the file
has 0 written
Based on a Chromium patch
Originally committed as revision 23167 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/matroskadec.c')
-rw-r--r-- | libavformat/matroskadec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 556d6b9eb8..4d18d99e15 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1154,6 +1154,8 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) 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; |