Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2015-03-18 23:57:58 +0300
committerMichael Niedermayer <michaelni@gmx.at>2015-03-19 04:20:30 +0300
commitb61cb61ab8f9abca98cc8c4d67cbefdb30f1e82a (patch)
treea92bb350713c4719dd0834da7d56ea895d4df236 /libavformat/mxfenc.c
parentc5c09501f947ccffd98de45ac87050d703c1e6a5 (diff)
mxfenc: don't try to write footer without header
This fixes a crash, when trying to mux h264 into mxf_opatom. Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> Previous version reviewed-by: tomas.hardin@codemill.se Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mxfenc.c')
-rw-r--r--libavformat/mxfenc.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index e9c4a9dc84..0349e5d34d 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -2402,6 +2402,13 @@ static int mxf_write_footer(AVFormatContext *s)
AVIOContext *pb = s->pb;
int err = 0;
+ if (!mxf->header_written ||
+ (s->oformat == &ff_mxf_opatom_muxer && !mxf->body_partition_offset)) {
+ /* reason could be invalid options/not supported codec/out of memory */
+ err = AVERROR_UNKNOWN;
+ goto end;
+ }
+
mxf->duration = mxf->last_indexed_edit_unit + mxf->edit_units_count;
mxf_write_klv_fill(s);