[FFmpeg-cvslog] matroska: do not set invalid default duration if frame rate is zero
Mans Rullgard
git at videolan.org
Wed Apr 18 22:28:26 CEST 2012
ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Wed Apr 18 13:48:20 2012 +0100| [3c58300269768e2dcd5cd8b55d56ecab99cb32f1] | committer: 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: Mans Rullgard <mans at mansr.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3c58300269768e2dcd5cd8b55d56ecab99cb32f1
---
libavformat/matroskadec.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 03d7c32..99e0dac 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -1342,7 +1342,7 @@ static int matroska_read_header(AVFormatContext *s)
continue;
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;
if (!track->video.display_width)
track->video.display_width = track->video.pixel_width;
More information about the ffmpeg-cvslog
mailing list