diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2015-11-15 17:46:08 +0100 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2015-11-26 01:37:56 +0100 |
commit | cc0e35c44153f79401b97f988ab5d8bb26efcde3 (patch) | |
tree | 31ad34eb111e297bd87af0b8ac88a9fe3d84a18e | |
parent | d52df5cffa18860ae73bb5410c4430b40f25e4d6 (diff) | |
download | ffmpeg-cc0e35c44153f79401b97f988ab5d8bb26efcde3.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>
(cherry picked from commit 047bf82c181c1220b3087b37f28445f8b87a7a23)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
-rw-r--r-- | libavformat/mxfdec.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 636a3d8932..34ec5527cf 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -1596,6 +1596,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; |