aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-08-29 21:26:43 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-12-06 20:30:57 +0100
commit0e704512b5746ab135f38bb13c335f991ffdc9e2 (patch)
treec1ad38084c317d7c7baa15822a3e0d997fe7b81c /libavcodec
parentc01055a1ffe11390adf23ffa30516408cfcc5c3d (diff)
downloadffmpeg-0e704512b5746ab135f38bb13c335f991ffdc9e2.tar.gz
avcodec/qdm2: Check frame size
Fixes: index 2304 out of bounds for type 'float [2304]' Fixes: 16332/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QDM2_fuzzer-5679142481166336 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 12b909ba319d32ed100d9b26021aa9b6976424d7) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/qdm2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index 5ceec3420d..79a4738a3d 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -1750,6 +1750,11 @@ static av_cold int qdm2_decode_init(AVCodecContext *avctx)
s->sub_sampling = s->fft_order - 7;
s->frequency_range = 255 / (1 << (2 - s->sub_sampling));
+ if (s->frame_size * 4 >> s->sub_sampling > MPA_FRAME_SIZE) {
+ avpriv_request_sample(avctx, "large frames");
+ return AVERROR_PATCHWELCOME;
+ }
+
switch ((s->sub_sampling * 2 + s->channels - 1)) {
case 0: tmp = 40; break;
case 1: tmp = 48; break;