]> git.sesse.net Git - ffmpeg/commitdiff
avformat/segafilm: Check that there is a stream
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 21 Oct 2020 22:37:25 +0000 (00:37 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 22 Oct 2020 16:51:27 +0000 (18:51 +0200)
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 <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/segafilm.c

index 4d14b81d163eee6fb5587f855c48c23abc2849b0..17592c905e31290a52c39cdb25dd676200c67076 100644 (file)
@@ -144,6 +144,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);