From 647b235ec1878247f9cd796b20a64fcda377560a Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 13 Aug 2025 13:11:23 +0200 Subject: [PATCH] avcodec/aac/aacdec: dont allow ff_aac_output_configure() allocating a new frame if it has no frame Fixes: null pointer dereference Fixes: crash_test.mp4 Found-by: Intel PSIRT Signed-off-by: Michael Niedermayer (cherry picked from commit fcf180d9ea27b7dc29658c9dc3488ae6fac3ebd9) Signed-off-by: Michael Niedermayer --- libavcodec/aacdec_template.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavcodec/aacdec_template.c b/libavcodec/aacdec_template.c index 954399f86b..eaa2e973cc 100644 --- a/libavcodec/aacdec_template.c +++ b/libavcodec/aacdec_template.c @@ -454,6 +454,9 @@ static int output_configure(AACContext *ac, uint8_t id_map[TYPE_END][MAX_ELEM_ID] = {{ 0 }}; uint8_t type_counts[TYPE_END] = { 0 }; + if (get_new_frame && !ac->frame) + return AVERROR_INVALIDDATA; + if (ac->oc[1].layout_map != layout_map) { memcpy(ac->oc[1].layout_map, layout_map, tags * sizeof(layout_map[0])); ac->oc[1].layout_map_tags = tags;