diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-29 20:49:27 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-09 22:02:21 +0200 |
commit | 6d7f466d72344592cc8d3b429c081b11a8b250e1 (patch) | |
tree | 67ce5aa8959934b46a85f305e7b7f70888ec1dec | |
parent | 5a514d8e9b9ce8e6df929793124196b60897c698 (diff) | |
download | ffmpeg-6d7f466d72344592cc8d3b429c081b11a8b250e1.tar.gz |
avformat/rmdec: Check for multiple audio_stream_info
Fixes: memleak
Fixes: 39166/clusterfuzz-testcase-minimized-ffmpeg_dem_IVR_fuzzer-5153276690038784
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 8fe3566b8fdf4bcf5eed419c1aab6eb848287ff3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/rmdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index b7f7dd00b4..29ed4d706e 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -131,6 +131,10 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb, uint32_t version; int ret; + // Duplicate tags + if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) + return AVERROR_INVALIDDATA; + /* ra type header */ version = avio_rb16(pb); /* version */ if (version == 3) { |