aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-03-30 11:03:56 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2021-09-10 16:04:26 +0200
commitddcaa14abbe1fec4099ff844ac60e089b3b4e92e (patch)
tree9271e783b7165980bf96e833ce3e6adf90c34e19
parent7cafb6461dfebf62d7292004394d9633bdea4a7a (diff)
downloadffmpeg-ddcaa14abbe1fec4099ff844ac60e089b3b4e92e.tar.gz
avformat/rmdec: use larger intermediate type for audio_framesize * sub_packet_h check
Fixes: signed integer overflow: 65535 * 65535 cannot be represented in type 'int' Fixes: 31406/clusterfuzz-testcase-minimized-ffmpeg_dem_IVR_fuzzer-5024692843970560 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 cf2fd9204b3c707d9e414583b043ee88b8e8c52e) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/rmdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 5dfbc4a0ef..9445356695 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -295,7 +295,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
ast->deint_id == DEINT_ID_GENR ||
ast->deint_id == DEINT_ID_SIPR) {
if (st->codecpar->block_align <= 0 ||
- ast->audio_framesize * sub_packet_h > (unsigned)INT_MAX ||
+ ast->audio_framesize * (uint64_t)sub_packet_h > (unsigned)INT_MAX ||
ast->audio_framesize * sub_packet_h < st->codecpar->block_align)
return AVERROR_INVALIDDATA;
if (av_new_packet(&ast->pkt, ast->audio_framesize * sub_packet_h) < 0)