[FFmpeg-cvslog] avformat/mxfdec: return error instead of segfaulting if there are no streams

Michael Niedermayer git at videolan.org
Tue Jun 2 14:18:49 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun May 31 13:11:10 2015 +0200| [e43f3c8858778caba832810d555e4b67ed90a7b7] | committer: Michael Niedermayer

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

Fixes segfault from ticket 4350

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/mxfdec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
index c8f1c61..78e2393 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];



More information about the ffmpeg-cvslog mailing list