[FFmpeg-devel] [PATCH 04/11] avcodec/aac/aacdec_usac: Dont leave invalid max_sfb in the context

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


Fixes: out of array read
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_usac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/aac/aacdec_usac.c b/libavcodec/aac/aacdec_usac.c
index 32b3c534bf1..1b79d19a30f 100644
--- a/libavcodec/aac/aacdec_usac.c
+++ b/libavcodec/aac/aacdec_usac.c
@@ -834,6 +834,7 @@ static int setup_sce(AACDecContext *ac, SingleChannelElement *sce,
                "Number of scalefactor bands in group (%d) "
                "exceeds limit (%d).\n",
                ics->max_sfb, ics->num_swb);
+        ics->max_sfb = 0;
         return AVERROR(EINVAL);
     }
 
-- 
2.45.2



More information about the ffmpeg-devel mailing list