Commit e43f3c88 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/mxfdec: return error instead of segfaulting if there are no streams

Fixes segfault from ticket 4350
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent bb1f153a
...@@ -2995,6 +2995,10 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -2995,6 +2995,10 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
if (mxf->op != OPAtom) if (mxf->op != OPAtom)
return mxf_read_packet_old(s, pkt); return mxf_read_packet_old(s, pkt);
// If we have no streams then we basically are at EOF
if (s->nb_streams < 1)
return AVERROR_EOF;
/* OPAtom - clip wrapped demuxing */ /* OPAtom - clip wrapped demuxing */
/* NOTE: mxf_read_header() makes sure nb_index_tables > 0 for OPAtom */ /* NOTE: mxf_read_header() makes sure nb_index_tables > 0 for OPAtom */
st = s->streams[0]; st = s->streams[0];
......
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