avformat/concatdec: avoid NULL dereference when failed to open file.
authorZhang Rui <bbcallen@gmail.com>
Thu, 29 Jan 2015 09:55:32 +0000 (17:55 +0800)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 29 Jan 2015 13:25:04 +0000 (14:25 +0100)
Reviewed-by: Nicolas George <george@nsup.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/concatdec.c

index e109524..f07cfd7 100644 (file)
@@ -482,6 +482,9 @@ static int concat_read_packet(AVFormatContext *avf, AVPacket *pkt)
     ConcatStream *cs;
     AVStream *st;
 
+    if (!cat->avf)
+        return AVERROR(EIO);
+
     while (1) {
         ret = av_read_frame(cat->avf, pkt);
         if (ret == AVERROR_EOF) {