From patchwork Mon Jun 10 19:09:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 49779 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:c209:0:b0:460:55fa:d5ed with SMTP id d9csp2736954vqo; Mon, 10 Jun 2024 12:10:08 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCW1SW8CwfYTVhsxtrXnHPFx0yCkJ2vn1jNC8PiryYOtynhO/ZLvZf3gLBxf56jmq6bvsq1SsJCQKrmYaJBxuNUWKy1NKGAcagpExw== X-Google-Smtp-Source: AGHT+IGB6oSXgWdqXGzkmP7Iden9ME29OJrwsha23zh0Ne/oRjrkfswYOrdJN+drWV17dyktea/1 X-Received: by 2002:a50:8d18:0:b0:57c:8022:a3db with SMTP id 4fb4d7f45d1cf-57c8022a950mr2670566a12.6.1718046608487; Mon, 10 Jun 2024 12:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718046608; cv=none; d=google.com; s=arc-20160816; b=BXBEfYPqdxoLDywGL7QZzBdqaYIyg+MqN1UYWEPiPG/hx7SfkbuUlp9/9sKRaDWgJ6 sfgeu99uyiR2y+OeXagk13YzaPTzIgDb6PzoAKi6xbWz2uMrf8YG8tE44MjjmPNKgEvG Jl+nSPAS12BeihGVs2PctOknQk+TqpEWNhZRr4fPW6Q8G0PJSc/HwC6YyocDw++V20+E U0MaEGR3z3gAB6Yqz0QkrhiKMzr7TwgB5HLVB/QDnuO/RUhJ7vO8qal4yBPx+QHpR/Z6 TV/Bg1cjLiOwJTJV1Gg0JniFd5HMyT15HvLWgYvJFkrnkxYfnAWT+AKXJZNeZWZ4+0Kk q2EQ== 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:message-id:date:to:from :dkim-signature:delivered-to; bh=n6Hbq8lF9BbKeTRcpxh56ZLJYgOs12BB0nVD7XheYtg=; fh=e5zN9xSzcxLA6bGo3lF+CqTbY/oLwzApV03EO/RBfgQ=; b=YLGF98FOygp8cpbtfYiZn5WOgZJgVKFzx/LF7Ex5qAYMDN/z3Xb7u4MOH4Poiasc8e mKYUrwFzN8q2ZYW+9i9nBcDe7kAYbaMEfGo/hOs+45FzNQazT6Zky10k9mZ/Cfdp59fA thFFW7Qjd1DSHnLuA4QUACQmUb4iITMmd3Q/svcHHeHC5gaNuh1AzLv3A80j61VaFGss +wdBh+TwsIJ9GCFlKy4be1x03BX+dWtGUDtvhQ10wB9IXl+t/M7ahINA3cjevY+60KWO zrsrS81kfy3NIGehTY3Tetvy5MVCMoiLUrD24BY9VOHAFc1FtkzPPyE0z+KDTzguk5/T 7ZEg==; 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=nd4d6S1n; 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 4fb4d7f45d1cf-57c77ef590esi1916752a12.193.2024.06.10.12.10.07; Mon, 10 Jun 2024 12:10:08 -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=nd4d6S1n; 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 BD68368D6A3; Mon, 10 Jun 2024 22:10:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A035C68D6A1 for ; Mon, 10 Jun 2024 22:09:58 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id D2245FF804 for ; Mon, 10 Jun 2024 19:09:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1718046598; 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; bh=vlgmOkUI3e7d0vcDOK0knm6aweGuSEFz+RvgN3snJUo=; b=nd4d6S1nbhOSUl6cn42cS8TSXbQrBvVrEFOMbvAOyFsJl7JsPacEPKuHnq0tmP1dAoBLu6 npWikgAk14ekegjwsS4+4XUfNv/j+q4jgh4v655fKZccrHHnKTti8ZXOcL9mLJzjKcSwr7 suKaONCiE0K4TUGebOG+fICFdggrsZnwpRaeEB0lEmOTejWlYgkuVN8is1FQXdhbvsg4Sp JFP6sZD/kZHWI1lg5Nl7WuqRofvQg59+gczxkrPN+qo18CMJBkU20WscVQH0wcKbX4mPNt DwD0TvjWkuXULSs9JycSQJR5TTr+AzHorWFPW/ByPwj+6SlTt3gLF1MLf4RG7g== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 10 Jun 2024 21:09:54 +0200 Message-ID: <20240610190956.2615107-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 1/3] avfilter/af_afftdn: Assert format 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: HiACKFbpKJ2/ Maybe helps: CID1515514 Uninitialized scalar variable Maybe helps: CID1515517 Uninitialized scalar variable Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavfilter/af_afftdn.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavfilter/af_afftdn.c b/libavfilter/af_afftdn.c index 96c2246074c..a2e6ca61076 100644 --- a/libavfilter/af_afftdn.c +++ b/libavfilter/af_afftdn.c @@ -20,6 +20,7 @@ #include +#include "libavutil/avassert.h" #include "libavutil/avstring.h" #include "libavutil/channel_layout.h" #include "libavutil/mem.h" @@ -376,6 +377,8 @@ static void process_frame(AVFilterContext *ctx, case AV_SAMPLE_FMT_DBLP: noisy_data[i] = mag = hypot(fft_data_dbl[i].re, fft_data_dbl[i].im); break; + default: + av_assert2(0); } power = mag * mag; @@ -970,6 +973,8 @@ static void sample_noise_block(AudioFFTDeNoiseContext *s, mag2 = fft_out_dbl[n].re * fft_out_dbl[n].re + fft_out_dbl[n].im * fft_out_dbl[n].im; break; + default: + av_assert2(0); } mag2 = fmax(mag2, s->sample_floor);