[FFmpeg-devel] [PATCH 1/5] avcodec/aac/aacdec_usac: Test ac in usac

Michael Niedermayer michael at niedermayer.cc
Mon Jun 24 02:01:33 EEST 2024


ff_aac_usac_config_decode() needs AACDecContext to be set but some callers
pass NULL.

I have no real testcase to implement/test this, so failing in this case
seems safest.

Fixes: member access within null pointer of type 'AACDecContext' (aka 'struct AACDecContext')
Fixes: 69435/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5733527483121664

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 | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/aac/aacdec_usac.c b/libavcodec/aac/aacdec_usac.c
index 132ffee9c20..4856c1786b7 100644
--- a/libavcodec/aac/aacdec_usac.c
+++ b/libavcodec/aac/aacdec_usac.c
@@ -348,6 +348,9 @@ int ff_aac_usac_config_decode(AACDecContext *ac, AVCodecContext *avctx,
     int map_pos_set = 0;
     uint8_t layout_map[MAX_ELEM_ID*4][3] = { 0 };
 
+    if (!ac)
+        return AVERROR_PATCHWELCOME;
+
     memset(usac, 0, sizeof(*usac));
 
     freq_idx = get_bits(gb, 5); /* usacSamplingFrequencyIndex */
-- 
2.45.2



More information about the ffmpeg-devel mailing list