[FFmpeg-cvslog] avformat/concatdec: avoid NULL dereference when failed to open file.

Zhang Rui git at videolan.org
Thu Jan 29 14:32:33 CET 2015


ffmpeg | branch: master | Zhang Rui <bbcallen at gmail.com> | Thu Jan 29 17:55:32 2015 +0800| [038f3a173f59c9fc3396aa38e7972661da7ca504] | committer: Michael Niedermayer

avformat/concatdec: avoid NULL dereference when failed to open file.

Reviewed-by: Nicolas George <george at nsup.org>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/concatdec.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index e109524..f07cfd7 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -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) {



More information about the ffmpeg-cvslog mailing list