mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-11-16 07:32:34 +03:00
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
This commit is contained in:
1 parent
1c664b239c
commit
d98bd80ed3
1 file changed
+2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user