1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-03-17 20:17:55 +02:00

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>
This commit is contained in:
Michael Niedermayer 2021-09-29 20:49:27 +02:00
parent c3971ff707
commit a85739087d

View File

@ -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) {