[FFmpeg-cvslog] avcodec/qdm2: Check fft_coefs_index

Michael Niedermayer git at videolan.org
Fri Apr 24 02:13:57 EEST 2020


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Tue Feb 18 22:58:12 2020 +0100| [69f0f5a93da0566faad6c436b5527283747dd81e] | committer: Michael Niedermayer

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 at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 9fc73bf022eb781eea7f685e2d2e9de4ba8898ca)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=69f0f5a93da0566faad6c436b5527283747dd81e
---

 libavcodec/qdm2.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c
index 79a4738a3d..338bab5ebb 100644
--- a/libavcodec/qdm2.c
+++ b/libavcodec/qdm2.c
@@ -1332,6 +1332,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)



More information about the ffmpeg-cvslog mailing list