diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2021-02-15 20:52:17 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2021-02-16 19:02:24 +0100 |
commit | d558c9f2375fd2136d20422cb1119cfbf872abeb (patch) | |
tree | b054781b33ade1fab08f5a460b8243ddba45e3b5 /libavformat/rmdec.c | |
parent | 1d277b92fa4c149d589e6828d4e18ad578406f1f (diff) | |
download | ffmpeg-d558c9f2375fd2136d20422cb1119cfbf872abeb.tar.gz |
avformat/rmdec: Check codec_length without overflow
Fixes: signed integer overflow: 2147483647 + 64 cannot be represented in type 'int'
Fixes: 30333/clusterfuzz-testcase-minimized-ffmpeg_dem_RM_fuzzer-5175286983426048
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/rmdec.c')
-rw-r--r-- | libavformat/rmdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 521b9d0e8c..610189ecb4 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -223,7 +223,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb, if (version == 5) avio_r8(pb); codecdata_length = avio_rb32(pb); - if(codecdata_length + AV_INPUT_BUFFER_PADDING_SIZE <= (unsigned)codecdata_length){ + if((unsigned)codecdata_length > INT_MAX - AV_INPUT_BUFFER_PADDING_SIZE){ av_log(s, AV_LOG_ERROR, "codecdata_length too large\n"); return -1; } |