From patchwork Wed Jul 31 19:54:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 50836 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:12d6:0:b0:489:2eb3:e4c4 with SMTP id 205csp713008vqs; Wed, 31 Jul 2024 12:54:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXLR9mn0q1Lvdd4WzhFD6XHVho1sNKa3YMUb2XYQMsyl1FikBCI15jod5iB5zY3xP0a0jOkE+VCsU7CphUXAuAaAV7DEACGc3g03g== X-Google-Smtp-Source: AGHT+IG3rTg39uZ3MGfWdO3UqYJs7vcdmnzvrtBxrHFZeNlDRVdCNk8n1sadRiqUJX6Bo7QaA2k7 X-Received: by 2002:a2e:9e44:0:b0:2ef:32bb:5368 with SMTP id 38308e7fff4ca-2f1530ea1e2mr3870771fa.11.1722455688260; Wed, 31 Jul 2024 12:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1722455688; cv=none; d=google.com; s=arc-20160816; b=Mz/C7gcRyOVDv9Gw60ycqm1kQLS1a4I0kSt/81E0zj/gU3HpjgBttm4GY41rSKX0Jh uAGbA75oeoJz8PDQTTU3YTs2CiIFa0e2yBoOn4xa3YL2w8Lv5GKDzK+pJguwLjWJibHX vmbjEaMqcOMm/+T+Ad9Cg79yj5fzNrvwD5EFsLZmn4iP2qdE7OFGFxnBpi3Jb+zlRiLx Ej31iHw/uctg5nGy4ZsQn94K/Rtblv2y2Xi8Jmk+/6PGM8CLeTfPnQjKaQAiMYumoCGQ 1zVilgIachd9ArCafG3fLAeoaFXm/MTf7DBUtD30Elr2eAilJebh0g3hhtId92UUGE9V T3qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=+xVl1EETch3pAHnLPUA866E7lPe4GNW0hnruqwGjqO0=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=Qy7Foek3Pu2uCe2iUB45fpyJrcPZXkne9uVA1VIyZ0ls9ksrpfHflXLsLNtVtWtu5f ZEaALhdufys+NT4GdUa0Y5loe04vNvqd9OyccEj+8MGCPyvfNSLA4G6wy0Bk5VlJpJOi GRwotI3AGJxL0lyvEyB8CqEPg1dM1al361C/sM1J3Of4ZGnxGgmjAVZYJ4Y8LhCEc7sL v87Urhw6o4FNbArDvjZc8DGA39B4Xq8bhDbWqzrB7CpuuB9QLvBvugW8Z4/Vk7XnFfgc gTK/BrkgrrTu0EqQqkpfKu2AaoHp8uy1w2bQdiHBRhsFN9yVf7IUmquqJ4sPtBGxzW29 rljA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=eFwhWGn4; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id 38308e7fff4ca-2f03d169bd8si38917621fa.480.2024.07.31.12.54.47; Wed, 31 Jul 2024 12:54:48 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@niedermayer.cc header.s=gm1 header.b=eFwhWGn4; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8FDF768D8C3; Wed, 31 Jul 2024 22:54:23 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org 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 CF8BC68BF43 for ; Wed, 31 Jul 2024 22:54:14 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 381BCC0003 for ; Wed, 31 Jul 2024 19:54:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1722455654; 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=o5mi0Lh5h/zfCY1tgonTB/wVMJ5jrbArwaRHrS4gGp4=; b=eFwhWGn4ld8IIDeqYf2nb++paMAhnHLGbYvio4PV04r80Q4L4LtEoNLnJiEp6twhTkpPz9 fp3Iv6ZGFU0J/rDJEIpWoCoKIcGcoAft9ktS0zAz++zqSOTxcxS/bUXGT5ySfotMsQmeH3 e1S9B4VSLzNWWTkEDs61tR3D7Bd82PEfqP6UOPwv/Hkcotp20YYyrqO/1KXgGHBqocxvxv snaclAqgiogDL8wPAagV89Up5mwk3y6Lsan97ZjsMTW9CX1Zz/Gc/Xdyjevw2GFkB8GMC3 Nk9nVVCe1Wc1K4UmnLsiA9f6Yl/2hA0ctmyDSYUiebW1mRNgu8dmST45fx/bIw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 31 Jul 2024 21:54:08 +0200 Message-ID: <20240731195410.274508-4-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240731195410.274508-1-michael@niedermayer.cc> References: <20240731195410.274508-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 4/6] avcodec/aac/aacdec_usac: Clean ics2->max_sfb when first SCE fails 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: kx53rOWIk9q7 Fixes: out of array access Fixes: 70734/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-4741427068731392 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 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavcodec/aac/aacdec_usac.c b/libavcodec/aac/aacdec_usac.c index 82db65eb0d0..2938e693874 100644 --- a/libavcodec/aac/aacdec_usac.c +++ b/libavcodec/aac/aacdec_usac.c @@ -918,8 +918,10 @@ static int decode_usac_stereo_info(AACDecContext *ac, AACUSACConfig *usac, } ret = setup_sce(ac, sce1, usac); - if (ret < 0) + if (ret < 0) { + ics2->max_sfb = 0; return ret; + } ret = setup_sce(ac, sce2, usac); if (ret < 0)