summaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-10-11 00:40:07 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-10-17 18:04:37 +0200
commit2fca09bce49c7de590560d9517fd2414b6c0c14f (patch)
treeca1f7324b3c7825716bd48e6db48e4bf61d0d394 /libavcodec
parentb288a7eb3d963a175e177b6219c8271076ee8590 (diff)
downloadffmpeg-streaming-2fca09bce49c7de590560d9517fd2414b6c0c14f.zip
ffmpeg-streaming-2fca09bce49c7de590560d9517fd2414b6c0c14f.tar.gz
avcodec/binkaudio: Check sample rate
Fixes: signed integer overflow: 1092624416 * 2 cannot be represented in type 'int' Fixes: 18045/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BINKAUDIO_RDFT_fuzzer-5718519492116480 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Reviewed-by: Peter Ross <pross@xvid.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/binkaudio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index 96cf968..2384ebf 100644
--- a/libavcodec/binkaudio.c
+++ b/libavcodec/binkaudio.c
@@ -95,6 +95,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
if (avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT) {
// audio is already interleaved for the RDFT format variant
avctx->sample_fmt = AV_SAMPLE_FMT_FLT;
+ if (sample_rate > INT_MAX / avctx->channels)
+ return AVERROR_INVALIDDATA;
sample_rate *= avctx->channels;
s->channels = 1;
if (!s->version_b)
OpenPOWER on IntegriCloud