[FFmpeg-cvslog] mxfenc: don't try to write footer without header

Andreas Cadhalpun git at videolan.org
Thu May 14 20:58:36 CEST 2015


ffmpeg | branch: release/2.6 | Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com> | Wed Mar 18 21:57:58 2015 +0100| [763ab41f771c7d5be3912aa4a69270b53fa0d401] | committer: Andreas Cadhalpun

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 at googlemail.com>
Previous version reviewed-by: tomas.hardin at codemill.se
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

(cherry picked from commit b61cb61ab8f9abca98cc8c4d67cbefdb30f1e82a)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=763ab41f771c7d5be3912aa4a69270b53fa0d401
---

 libavformat/mxfenc.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index eb608ca..ac19b08 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -2265,6 +2265,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);



More information about the ffmpeg-cvslog mailing list