summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2020-12-18 23:13:58 +0100
committerMichael Niedermayer <[email protected]>2021-09-11 21:23:49 +0200
commit599b9b89d1bccf2e72a75bc6e546b6ac0a898fa0 (patch)
tree4673981cc8b03bdfeb05c5f12f1fd3462d7371a9
parent15e4a29785bc8c04a52540a9b64c6da41fd27c64 (diff)
avformat/rmdec: Fix codecdata_length overflow check
Fixes: signed integer overflow: 2147483647 + 64 cannot be represented in type 'int' Fixes: 28509/clusterfuzz-testcase-minimized-ffmpeg_dem_IVR_fuzzer-6310969680723968 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <[email protected]> (cherry picked from commit 3c41d0bfd6041890b394a3e6eb2f8da92b83416b) Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavformat/rmdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 64b3b6aa4f..6f0cb1c549 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -257,7 +257,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;
}