Commit b51e7554 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/mxfenc: Do not crash if there is no packet in the first stream

Fixes: Ticket4914
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 780c4223
......@@ -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;
}
......
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