[FFmpeg-devel] [PATCH] avcodec/binkaudio: Check sample_rate to avoid integer overflow
Michael Niedermayer
michael at niedermayer.cc
Tue Jan 14 16:36:45 EET 2020
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
Fixes: 19950/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_BINKAUDIO_DCT_fuzzer-5765514337189888
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
libavcodec/binkaudio.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c
index 64a08b8608..2df3dc645a 100644
--- a/libavcodec/binkaudio.c
+++ b/libavcodec/binkaudio.c
@@ -106,6 +106,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
avctx->sample_fmt = AV_SAMPLE_FMT_FLTP;
}
+ if (sample_rate >= INT_MAX)
+ return AVERROR_INVALIDDATA;
+
s->frame_len = 1 << frame_len_bits;
s->overlap_len = s->frame_len / 16;
s->block_size = (s->frame_len - s->overlap_len) * s->channels;
--
2.24.0
More information about the ffmpeg-devel
mailing list