[FFmpeg-devel] [PATCH 05/11] avcodec/aac/aacdec_lpd: Check kv indec

Michael Niedermayer michael at niedermayer.cc
Sat Jul 20 03:52:35 EEST 2024


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>
---
 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 91a32688895..20bbb007ff3 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)
-- 
2.45.2



More information about the ffmpeg-devel mailing list