From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 9AD0B4997A for ; Sun, 23 Jun 2024 23:02:23 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8361168D655; Mon, 24 Jun 2024 02:01:52 +0300 (EEST) Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 54AA868CF50 for ; Mon, 24 Jun 2024 02:01:43 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id AEDC81BF205 for ; Sun, 23 Jun 2024 23:01:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1719183702; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lOgBhVLruIlJ6x6FOPCSf/ljRUOba1vvYuSlniB1mGs=; b=pqhHEun6rj3bCq+OR1OzXddtLAirjvJb7UdYMQb8sgeR10g7EoOy5AzVZtMKCWSUNbs5LF VL7wAXYNs0l8D072wqLN8oI4XktSoTIVIZyHn+dRPAaCVLJBbJ236DXwFA7H3A4w/R4svq rkeZpb3fZpgYgfPTx8F6J2LzeiAXtit7WjqbGA2vsoJP8Hf+A64P+dCugWzE37MhOKvADT rjiOBDT9KcYuwTLzFxqWedSzFcYKmQD7eG2YsgyELH5105Ee01W7yVuLus+kT+EXrnG07T W/YrB6lVCO+AMnqmUfHGkeCtQe+opFOgnupF130JWSYToytsfSrP9/tABJjxew== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 24 Jun 2024 01:01:37 +0200 Message-ID: <20240623230137.1749178-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240623230137.1749178-1-michael@niedermayer.cc> References: <20240623230137.1749178-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 5/5] avformat/iamf: Check substreams in ff_iamf_free_audio_element() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Fixes: member access within null pointer of type 'IAMFSubStream' (aka 'struct IAMFSubStream') Fixes: 69795/clusterfuzz-testcase-minimized-ffmpeg_dem_IAMF_fuzzer-6216287009701888 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/iamf.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/iamf.c b/libavformat/iamf.c index 5de70dc0828..364cb60e021 100644 --- a/libavformat/iamf.c +++ b/libavformat/iamf.c @@ -74,8 +74,10 @@ void ff_iamf_free_audio_element(IAMFAudioElement **paudio_element) if (!audio_element) return; - for (int i = 0; i < audio_element->nb_substreams; i++) - avcodec_parameters_free(&audio_element->substreams[i].codecpar); + if (audio_element->substreams) + for (int i = 0; i < audio_element->nb_substreams; i++) { + avcodec_parameters_free(&audio_element->substreams[i].codecpar); + } av_free(audio_element->substreams); av_free(audio_element->layers); av_iamf_audio_element_free(&audio_element->element); -- 2.45.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".