diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-09-29 20:49:27 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-10-12 16:46:06 +0200 |
commit | 707d85b356934561be4951348c9b9c88b53e94c6 (patch) | |
tree | 4f04b5d058a89b896e9ecfad86de1074a0c8782b | |
parent | 523098c8b99661581f6cec7696099d59e243d7c6 (diff) | |
download | ffmpeg-707d85b356934561be4951348c9b9c88b53e94c6.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 fc80a7925f..a8360816b0 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -127,6 +127,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) { |