Commit 000247a6 authored by conrad's avatar conrad

matroskadec: Ensure time_scale is nonzero, fixes divide-by-zero if the file

has 0 written

Based on a Chromium patch

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@23167 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent e0814475
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment