aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-02-18 22:58:12 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-02-19 22:37:30 +0100
commit9fc73bf022eb781eea7f685e2d2e9de4ba8898ca (patch)
tree35faee19a32b6c833b36891435e5014898dc5055
parentbb01baae269cd2d7a0e61dc9bf327168edd43b04 (diff)
downloadffmpeg-9fc73bf022eb781eea7f685e2d2e9de4ba8898ca.tar.gz
avcodec/qdm2: Check fft_coefs_index
Fixes: out of array access Fixes: 20660/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_QDM2_fuzzer-5658290216501248 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/qdm2.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index 7b9d50b234..657b2da64d 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -1334,6 +1334,9 @@ static void qdm2_fft_decode_tones(QDM2Context *q, int duration,
if (q->frequency_range > (local_int_14 + 1)) {
int sub_packet = (local_int_20 + local_int_28);
+ if (q->fft_coefs_index + stereo >= FF_ARRAY_ELEMS(q->fft_coefs))
+ return;
+
qdm2_fft_init_coefficient(q, sub_packet, offset, duration,
channel, exp, phase);
if (stereo)