From 098c358a2df31099a5f7e5986e76f3c4cc5b1ff0 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 22 Oct 2020 00:37:25 +0200 Subject: [PATCH] avformat/segafilm: Check that there is a stream Fixes: assertion failure Fixes: 26472/clusterfuzz-testcase-minimized-ffmpeg_dem_SEGAFILM_fuzzer-5759751591559168 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Andreas Rheinhardt Signed-off-by: Michael Niedermayer (cherry picked from commit c0d7fd269beed030fc767fee28d9dbe111bc4427) Signed-off-by: Michael Niedermayer --- libavformat/segafilm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c index 44fa683a71..cec384918f 100644 --- a/libavformat/segafilm.c +++ b/libavformat/segafilm.c @@ -143,6 +143,9 @@ static int film_read_header(AVFormatContext *s) film->video_type = AV_CODEC_ID_NONE; } + if (!film->video_type && !film->audio_type) + return AVERROR_INVALIDDATA; + /* initialize the decoder streams */ if (film->video_type) { st = avformat_new_stream(s, NULL);