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 E72C54AFD8 for ; Tue, 25 Jun 2024 23:57:40 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5BA1668D435; Wed, 26 Jun 2024 02:57:37 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 582C468CAF3 for ; Wed, 26 Jun 2024 02:57:30 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id AF1CAC0002 for ; Tue, 25 Jun 2024 23:57:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1719359849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=W9y8MeqoCMO8zBqe0aE5wJIi/CiEn9lFFxn9D/Hvh74=; b=Z+K9+4RgBP934dNoXNQ/WUgFABgI6EKPnajCI1Bo1E8+tRZjNKSMJwd0POXVEWIAfwCEU+ k/wTNTbhd7fyMoLx09PgvXQ2h5yPx16VTC6wVe8nfw+x/mlMW0uXcOUwbMziTThd/oSddC 2+cNNCZcyPLEKFMFNfMkLrZzGytulrcTvsh/n/Od7+EP1uHW5VPcCx0SGm0HyNVwc8sHuK BlqLFY1JDo+1XqsgRcouRies5CGVDeNRZVgeCw1/dwPxPUatctwx5l+0j9CUEOBScWaY/5 GsJhiGQuk6KFrgRHT6Zsr1BYkTxkl9iFFgi/Ikgl4y4eP8Sa8BQBTJ3uHmUX+w== Date: Wed, 26 Jun 2024 01:57:28 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240625235728.GQ4991@pb2> References: <20240623230137.1749178-1-michael@niedermayer.cc> <2e1d95e9-b179-412c-ad81-f30bd32fef2a@lynne.ee> MIME-Version: 1.0 In-Reply-To: <2e1d95e9-b179-412c-ad81-f30bd32fef2a@lynne.ee> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH 1/5] avcodec/aac/aacdec_usac: Test ac in usac 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: multipart/mixed; boundary="===============2888196458767693696==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2888196458767693696== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="lYtTbTuCUQxZgETo" Content-Disposition: inline --lYtTbTuCUQxZgETo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 26, 2024 at 01:35:18AM +0200, Lynne via ffmpeg-devel wrote: > On 24/06/2024 01:01, Michael Niedermayer wrote: > > ff_aac_usac_config_decode() needs AACDecContext to be set but some call= ers > > pass NULL. > >=20 > > I have no real testcase to implement/test this, so failing in this case > > seems safest. > >=20 > > 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 > >=20 > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz= /tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/aac/aacdec_usac.c | 3 +++ > > 1 file changed, 3 insertions(+) > >=20 > > 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, AV= CodecContext *avctx, > > int map_pos_set =3D 0; > > uint8_t layout_map[MAX_ELEM_ID*4][3] =3D { 0 }; > > + if (!ac) > > + return AVERROR_PATCHWELCOME; > > + > > memset(usac, 0, sizeof(*usac)); > > freq_idx =3D get_bits(gb, 5); /* usacSamplingFrequencyIndex */ >=20 > This doesn't seem possible at all. > There are 2 callers, parse_audio_preroll and > decode_audio_specific_config_gb. Both of these will crash way before the > function is called. >=20 > Could you at least get a backtrace? sure libavcodec/aac/aacdec_usac.c:402:39: runtime error: member access within nu= ll pointer of type 'AACDecContext' (aka 'struct AACDecContext') SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior libavcodec/aac/aacd= ec_usac.c:402:39 in AddressSanitizer:DEADLYSIGNAL =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =3D=3D215602=3D=3DERROR: AddressSanitizer: SEGV on unknown address 0x000000= 005b10 (pc 0x00000154771e bp 0x7ffcf5049e90 sp 0x7ffcf5049e70 T0) =3D=3D215602=3D=3DThe signal is caused by a READ memory access. #0 0x154771d in av_channel_layout_uninit ffmpeg/libavutil/channel_layou= t.c:439:25 #1 0x57346e in ff_aac_usac_config_decode ffmpeg/libavcodec/aac/aacdec_u= sac.c:402:9 #2 0x500a0a in decode_audio_specific_config_gb ffmpeg/libavcodec/aac/aa= cdec.c:1050:20 #3 0x50a542 in latm_decode_audio_specific_config ffmpeg/libavcodec/aac/= aacdec_latm.h:80:21 #4 0x4f8638 in read_stream_mux_config ffmpeg/libavcodec/aac/aacdec_latm= =2Eh:160:24 #5 0x4f8638 in read_audio_mux_element ffmpeg/libavcodec/aac/aacdec_latm= =2Eh:233 #6 0x4f8638 in latm_decode_frame ffmpeg/libavcodec/aac/aacdec_latm.h:275 #7 0x68f26f in decode_simple_internal ffmpeg/libavcodec/decode.c:429:20 #8 0x68f26f in decode_simple_receive_frame ffmpeg/libavcodec/decode.c:6= 00 #9 0x68f26f in decode_receive_frame_internal ffmpeg/libavcodec/decode.c= :631 #10 0x68dc9d in avcodec_send_packet ffmpeg/libavcodec/decode.c:721:15 #11 0x4d1e55 in LLVMFuzzerTestOneInput ffmpeg/tools/target_dec_fuzzer.c= :534:25 [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Elect your leaders based on what they did after the last election, not based on what they say before an election. --lYtTbTuCUQxZgETo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZntZaAAKCRBhHseHBAsP q1+ZAKCMHVfd3LO4zbesNAc85OwscllXcACfbTJEmA3/Fp+VNBEQd6jvlbE8XxY= =CzUA -----END PGP SIGNATURE----- --lYtTbTuCUQxZgETo-- --===============2888196458767693696== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============2888196458767693696==--