summaryrefslogtreecommitdiff
path: root/libavformat/mxfdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-31 13:11:10 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-02 13:45:47 +0200
commite43f3c8858778caba832810d555e4b67ed90a7b7 (patch)
tree2b9f7ab0d52f40ea8d964d19b8b3afc5f77c0605 /libavformat/mxfdec.c
parentbb1f153a88f7334256f26d805b9d8f57b7cb66a5 (diff)
downloadffmpeg-e43f3c8858778caba832810d555e4b67ed90a7b7.tar.gz
avformat/mxfdec: return error instead of segfaulting if there are no streams
Fixes segfault from ticket 4350 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mxfdec.c')
-rw-r--r--libavformat/mxfdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index c8f1c61f9e..78e2393c18 100644
--- a/libavformat/mxfdec.c
+++ b/libavformat/mxfdec.c
@@ -2995,6 +2995,10 @@ static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt)
if (mxf->op != OPAtom)
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 */
/* NOTE: mxf_read_header() makes sure nb_index_tables > 0 for OPAtom */
st = s->streams[0];