diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-06-13 12:36:49 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-06-14 18:34:59 +0200 |
commit | 70277f12328fb052c2c758fa7f4eb36b9ea89638 (patch) | |
tree | daf0ba9cb1c94af7a140de6a38780ebfbd150c03 /libavformat/oggdec.c | |
parent | e53235f06c229a23d3241b47e32647019161fb7c (diff) | |
download | ffmpeg-70277f12328fb052c2c758fa7f4eb36b9ea89638.tar.gz |
avformat/oggdec: Disable mid stream codec changes
Fixes: 22082/clusterfuzz-testcase-minimized-ffmpeg_DEMUXER_fuzzer-5688619118624768
Fixes: crash from V-codecs/Theora/theora_testsuite_broken/multi2.ogg
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Suggested-by: Lynne on IRC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/oggdec.c')
-rw-r--r-- | libavformat/oggdec.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index 9eb45499c6..a456c3df60 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -226,9 +226,10 @@ static int ogg_replace_stream(AVFormatContext *s, uint32_t serial, char *magic, return AVERROR_INVALIDDATA; } - /* We only have a single stream anyway, so if there's a new stream with - * a different codec just replace it */ os = &ogg->streams[0]; + if (os->codec != codec) + return AVERROR(EINVAL); + os->serial = serial; os->codec = codec; os->serial = serial; |