Browse Source

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>
(cherry picked from commit 2fca09bce4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.2.2
Michael Niedermayer 6 years ago
parent
commit
b786eed33a
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      libavcodec/binkaudio.c

+ 2
- 0
libavcodec/binkaudio.c View File

@@ -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)


Loading…
Cancel
Save