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>2019-08-29 22:26:43 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2019-09-07 00:00:46 +0300
commite66d4725c7187d291edc9b1076585b1a48da907e (patch)
treefc7fd822c77e83822fd29d1ed566c2a423bd9045
parent5a1e0cae2f78b10cc7ab6cd41d6908c4ae89276f (diff)
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>
-rw-r--r--libavcodec/qdm2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index eaffb36dcc..ac8ae8cbbb 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -1727,6 +1727,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;