[FFmpeg-cvslog] avcodec/aac/aacdec_lpd: Check kv indec

Michael Niedermayer git at videolan.org
Wed Jul 24 00:24:22 EEST 2024


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Jul 19 22:22:33 2024 +0200| [2f7aaa33e7343435cbc468da42fbd52c9f8f7055] | committer: Michael Niedermayer

avcodec/aac/aacdec_lpd: Check kv indec

Fixes: index 9 out of bounds for type 'uint32_t [8][8]'
Fixes: 70363/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-6723855293415424.fuzz

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/aac/aacdec_lpd.c b/libavcodec/aac/aacdec_lpd.c
index 91a3268889..20bbb007ff 100644
--- a/libavcodec/aac/aacdec_lpd.c
+++ b/libavcodec/aac/aacdec_lpd.c
@@ -130,6 +130,9 @@ int ff_aac_parse_fac_data(AACUsacElemData *ce, GetBitContext *gb,
     if (use_gain)
         ce->fac.gain = get_bits(gb, 7);
 
+    if (len/8 > 8)
+        return AVERROR_PATCHWELCOME;
+
     for (int i = 0; i < len/8; i++) {
         ret = parse_codebook_idx(gb, ce->fac.kv[i], 1, 1);
         if (ret < 0)



More information about the ffmpeg-cvslog mailing list