[FFmpeg-cvslog] avformat/concatdec: Check file

Michael Niedermayer git at videolan.org
Sat May 25 01:56:57 EEST 2024


ffmpeg | branch: release/6.1 | Michael Niedermayer <michael at niedermayer.cc> | Tue Apr 30 00:47:31 2024 +0200| [ff547f5fd4984b59513d5ee8806fce7206c715f8] | committer: Michael Niedermayer

avformat/concatdec: Check file

Fixes: null pointer dereference
Fixes: -stream_loop 1 -ss 00:00:05 -i zgclab/ffmpeg_crash/poc2 -codec:v copy -codec:a aac -y output.mp4

Found-by: Wang Dawei and Zhou Geng, from Zhongguancun Laboratory
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit a5d1497f33afa17b6a3578b66638e69bf8a558de)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavformat/concatdec.c b/libavformat/concatdec.c
index 11c7f75fc0..cbddcc0af6 100644
--- a/libavformat/concatdec.c
+++ b/libavformat/concatdec.c
@@ -638,6 +638,11 @@ static int concat_parse_script(AVFormatContext *avf)
         }
     }
 
+    if (!file) {
+        ret = AVERROR_INVALIDDATA;
+        goto fail;
+    }
+
     if (file->inpoint != AV_NOPTS_VALUE && file->outpoint != AV_NOPTS_VALUE) {
         if (file->inpoint  > file->outpoint ||
             file->outpoint - (uint64_t)file->inpoint > INT64_MAX)



More information about the ffmpeg-cvslog mailing list