Commit b61cb61a authored by Andreas Cadhalpun's avatar Andreas Cadhalpun Committed by Michael Niedermayer

mxfenc: don't try to write footer without header

This fixes a crash, when trying to mux h264 into mxf_opatom.
Signed-off-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Previous version reviewed-by: tomas.hardin@codemill.se
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c5c09501
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment