aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-11-15 17:46:08 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-11-18 23:54:24 +0100
commit047bf82c181c1220b3087b37f28445f8b87a7a23 (patch)
tree633482ac723051ef6de72cb45dac5379f516ceba
parent6f37226b687f969bcf6e47a4fb5c28a32d107aa3 (diff)
downloadffmpeg-047bf82c181c1220b3087b37f28445f8b87a7a23.tar.gz
mxfdec: check edit_rate also for physical_track
Previously only the edit_rate of material_track was checked. If it's negative, it causes assertion failures in av_rescale_rnd. Reviewed-by: Tim Nicholson <nichot20-at-yahoo.com@ffmpeg.org> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r--libavformat/mxfdec.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index 99c8fede02..429f46a7e9 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -1776,6 +1776,16 @@ static int mxf_parse_physical_source_package(MXFContext *mxf, MXFTrack *source_t
continue;
}
+ if (physical_track->edit_rate.num <= 0 ||
+ physical_track->edit_rate.den <= 0) {
+ av_log(mxf->fc, AV_LOG_WARNING,
+ "Invalid edit rate (%d/%d) found on structural"
+ " component #%d, defaulting to 25/1\n",
+ physical_track->edit_rate.num,
+ physical_track->edit_rate.den, i);
+ physical_track->edit_rate = (AVRational){25, 1};
+ }
+
for (k = 0; k < physical_track->sequence->structural_components_count; k++) {
if (!(mxf_tc = mxf_resolve_timecode_component(mxf, &physical_track->sequence->structural_components_refs[k])))
continue;