[FFmpeg-devel] [PATCH] avformat/concatdec: Check that the opened file contains a stream.

Michael Niedermayer michaelni at gmx.at
Sun May 31 04:29:49 CEST 2015


Fixes segfault from ticket 4350

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavformat/concatdec.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index 07db9f9..9b482e2 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -299,6 +299,12 @@ static int open_file(AVFormatContext *avf, unsigned fileno)
         avformat_close_input(&cat->avf);
         return ret;
     }
+    if (cat->avf->nb_streams < 1) {
+        av_log(avf, AV_LOG_ERROR, "No streams in '%s'\n", file->url);
+        avformat_close_input(&cat->avf);
+        return AVERROR(EINVAL);
+    }
+
     cat->cur_file = file;
     if (file->start_time == AV_NOPTS_VALUE)
         file->start_time = !fileno ? 0 :
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list