Commit 3c583002 authored by Mans Rullgard's avatar Mans Rullgard

matroska: do not set invalid default duration if frame rate is zero

If a video track specifies a zero frame rate (invalid but occurs),
this results in a division by zero and subsequent undefined conversion
to integer.  Setting the default duration from the frame rate only
if the latter is greater than zero avoids such problems.
Signed-off-by: 's avatarMans Rullgard <mans@mansr.com>
parent ac97d47d
...@@ -1342,7 +1342,7 @@ static int matroska_read_header(AVFormatContext *s) ...@@ -1342,7 +1342,7 @@ static int matroska_read_header(AVFormatContext *s)
continue; continue;
if (track->type == MATROSKA_TRACK_TYPE_VIDEO) { if (track->type == MATROSKA_TRACK_TYPE_VIDEO) {
if (!track->default_duration) if (!track->default_duration && track->video.frame_rate > 0)
track->default_duration = 1000000000/track->video.frame_rate; track->default_duration = 1000000000/track->video.frame_rate;
if (!track->video.display_width) if (!track->video.display_width)
track->video.display_width = track->video.pixel_width; track->video.display_width = track->video.pixel_width;
......
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