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:
authorMichael Niedermayer <michael@niedermayer.cc>2015-12-13 18:13:22 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2015-12-13 18:42:48 +0300
commitb51e7554e74cbf007a1cab83c7bed3ad9fa2793a (patch)
tree55abeee751b68c8b5860fb12ea37f96fec93f3c6 /libavformat/mxfenc.c
parent780c4223a54396c3b352608002428fae7f378996 (diff)
avformat/mxfenc: Do not crash if there is no packet in the first stream
Fixes: Ticket4914 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/mxfenc.c')
-rw-r--r--libavformat/mxfenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 043daff73a..59eed2ec48 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -2469,6 +2469,10 @@ static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt)
}
mxf->edit_units_count++;
} else if (!mxf->edit_unit_byte_count && st->index == 1) {
+ if (!mxf->edit_units_count) {
+ av_log(s, AV_LOG_ERROR, "No packets in first stream\n");
+ return AVERROR_PATCHWELCOME;
+ }
mxf->index_entries[mxf->edit_units_count-1].slice_offset =
mxf->body_offset - mxf->index_entries[mxf->edit_units_count-1].offset;
}