aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2014-01-08 01:20:00 +0100
committerLuca Barbato <lu_zero@gentoo.org>2014-02-01 16:25:07 +0100
commit7d56f2fffc14ad02001ee0689bee76a759da9ede (patch)
tree04fe3249dd55948be1ba31cb6f4e2efedb1899fe
parent04ffd2203065b4bc6b85dfc3c7c8e14c98e40943 (diff)
downloadffmpeg-7d56f2fffc14ad02001ee0689bee76a759da9ede.tar.gz
mxf: Handle negative edit_rate
Default to 1/25.
-rw-r--r--libavformat/mxfdec.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index cb383b0ea2..31ac9a8080 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1422,6 +1422,15 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
if (st->duration == -1)
st->duration = AV_NOPTS_VALUE;
st->start_time = component->start_position;
+ if (material_track->edit_rate.num <= 0 ||
+ material_track->edit_rate.den <= 0) {
+ av_log(mxf->fc, AV_LOG_WARNING,
+ "Invalid edit rate (%d/%d) found on stream #%d, "
+ "defaulting to 25/1\n",
+ material_track->edit_rate.num,
+ material_track->edit_rate.den, st->index);
+ material_track->edit_rate = (AVRational){25, 1};
+ }
avpriv_set_pts_info(st, 64, material_track->edit_rate.den, material_track->edit_rate.num);
PRINT_KEY(mxf->fc, "data definition ul", source_track->sequence->data_definition_ul);