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