diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-08-11 14:41:13 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-11 21:23:48 +0200 |
commit | ea12dd67ee244db59ebb176b71a042865a03777d (patch) | |
tree | d69b88a6a87e55d09f503f9373a012d8d4ce8dee | |
parent | 40528776124d6c3761f2d68e3affda797311d8f5 (diff) | |
download | ffmpeg-ea12dd67ee244db59ebb176b71a042865a03777d.tar.gz |
avformat/siff: Reject audio packets without audio stream
Fixes: Assertion failure
Fixes: 24612/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-6600899842277376.fuzz
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8931c55789a69f717b4a6954c5bb7acf5475a134)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/siff.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/siff.c b/libavformat/siff.c index ddd1715680..e4da95ee0b 100644 --- a/libavformat/siff.c +++ b/libavformat/siff.c @@ -200,6 +200,8 @@ static int siff_read_packet(AVFormatContext *s, AVPacket *pkt) if (c->curstrm == -1) { c->pktsize = avio_rl32(s->pb) - 4; c->flags = avio_rl16(s->pb); + if (c->flags & VB_HAS_AUDIO && !c->has_audio) + return AVERROR_INVALIDDATA; c->gmcsize = (c->flags & VB_HAS_GMC) ? 4 : 0; if (c->gmcsize) avio_read(s->pb, c->gmc, c->gmcsize); |