Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-09-17 22:24:49 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2022-09-24 23:58:19 +0300
commit08047db178ecef92195127e44aa17e7977aec3db (patch)
treeb9e7ff512ab2f0f2023753b952d9e75767a84e6e
parentca55032020b1b441a493c2f4e2b69ce17d2438d2 (diff)
avformat/apm: Use 64bit for bit_rate computation
Fixes: signed integer overflow: -1155522528 * 4 cannot be represented in type 'int' Fixes: 50993/clusterfuzz-testcase-minimized-ffmpeg_dem_APM_fuzzer-6580670570299392 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 5b23cab5c769d6611a3fe111546d65809046a4d8) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/apm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/apm.c b/libavformat/apm.c
index baf7d2f941..a3ddc08e83 100644
--- a/libavformat/apm.c
+++ b/libavformat/apm.c
@@ -148,7 +148,7 @@ static int apm_read_header(AVFormatContext *s)
par->codec_id = AV_CODEC_ID_ADPCM_IMA_APM;
par->format = AV_SAMPLE_FMT_S16;
par->bit_rate = par->ch_layout.nb_channels *
- par->sample_rate *
+ (int64_t)par->sample_rate *
par->bits_per_coded_sample;
if ((ret = avio_read(s->pb, buf, APM_FILE_EXTRADATA_SIZE)) < 0)