From patchwork Tue Feb 20 17:49:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 46398 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:dda5:b0:19e:cdac:8cce with SMTP id kw37csp2009965pzb; Tue, 20 Feb 2024 09:47:36 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCU7pThf7kx1A17wz1yR0tWWwHCEWehO6uJ/JS/sJDoHnIgl2+tTBw9Lq+CK/O8HmQF5D5PdT/WJnSLTqHqtC5ySIkiJuUWs5b4qCg== X-Google-Smtp-Source: AGHT+IFrx419mFjCrKM5rYWZI7513lcaFivFv2cahNw45kPSpNqc3fZ6Lw1DTBlpjou39j/i5vhP X-Received: by 2002:ac2:5f50:0:b0:512:bc13:5ff0 with SMTP id 16-20020ac25f50000000b00512bc135ff0mr3350893lfz.50.1708451256371; Tue, 20 Feb 2024 09:47:36 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id u11-20020a170906408b00b00a3eaf97ac5esi1756557ejj.922.2024.02.20.09.47.35; Tue, 20 Feb 2024 09:47:36 -0800 (PST) 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=@outlook.com header.s=selector1 header.b=OoMxlMZq; arc=fail (body hash mismatch); 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B263668D22D; Tue, 20 Feb 2024 19:47:32 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2109.outbound.protection.outlook.com [40.92.89.109]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id F36FF68D081 for ; Tue, 20 Feb 2024 19:47:25 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BKcUJwojTVo4t65LBxnI3zwE7hqolV2KJPXzrZvqnKH6f5ihQPVyE0ZLo/Ulitt8K+ssk/EkjaSE06dyM4uOxVflOslvM4j3epaq0gfPILeq3NHEp9lV4NLcVZbEL/Gtjuhgg9zQSt6tkUWHDYu3dghNteI9w7RBtAyJMYahl91G8R1/MH30hA048w6XpMywfwa7BZ+UTj2fx61GBeHb47RVrN784x5qgGATc64ko8/NTGnefx/Zyc3KvoGf7BtgFgHW1aDkQL+Y0TfQOUAQBtOElC9HKNcpaJwgXe2VxGIfxlNuZAXS9irFcyazR80TPLVDNUszbXJ48aJUxiqZRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=usklXrF6Cuca+k3i2fIyqw/MsvsT3szg1vuKpP7895E=; b=U8N4GP5khVeU4WEJhMEIPvN1ls85HLa5IWYa03H9KQrvd9U4dXWHK+spR6ZfcNvdVV+YgUCdeJuwkQayYnYXQZKbP6skmOnDjNwUXI5q9DjiV+EWNEfg/0aKLA9XlDtc3N8HdAECgeeQYsfJuSHGgUPrDo7026DSCjrQsA1wDm/TYtSD0HPDG03Je1KA+CulXZf3NQB1pJIA4jOQOm8YZl2OF2xJfNsTgxxDcj12xIWvKHxqvzuFHmp1N9/6L/PDgXW+sadEOsm36k9mU5Tlngy5PwQ/yqmFOE3gxzyaqpSkqQoYL/fTeFXFnIjMstp58pYorzY7CbG2tcxpPhiWpQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=usklXrF6Cuca+k3i2fIyqw/MsvsT3szg1vuKpP7895E=; b=OoMxlMZq8SmtGO2t10oQEtzTmn3YXrMnBk+WEn4NC3g/9JlyqkXUWvGdxllc6rpkmggUEFsoyqejZJfqE4H+MSh3Rr6jVgWnZS20Oc7/b1B/+U/FIAYOsOauc1YSdiVpxomFDB8Lu6u0GlZbEUcSpcEzGOCHR0Oi/TyZhxpOnKCLzi5Eksybb+9puuXbEd/vP5M8OAzBLSWci3ipGO5ionJrUSlPHz9w/pbkS7LW+JKXp0u66AiJNkBPyHlMR1jOI1nhoLW2Ts0+zyfdha3Lig+paniUUXRYUUFTrWWGRHE4AzfANYg0ZbWTZLRmN8ZIp9gzBJ3/KawD2V1ECQbjPQ== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AS8P250MB0117.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:370::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.39; Tue, 20 Feb 2024 17:47:23 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d%5]) with mapi id 15.20.7292.033; Tue, 20 Feb 2024 17:47:23 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 20 Feb 2024 18:49:14 +0100 Message-ID: X-Mailer: git-send-email 2.34.1 X-TMN: [+DiF6LE5xAWsYblHXUAkALYGQky1cqkV] X-ClientProxiedBy: FR3P281CA0101.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a1::10) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240220174914.1398748-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|AS8P250MB0117:EE_ X-MS-Office365-Filtering-Correlation-Id: 45ce9e9c-f359-4a44-01f7-08dc323bfe80 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: f2wDP0awOtZ16/bzLY1wJSqxMN9bBGkA6vJjlHziTeXzahUPE/shUxtIfbhhTcd78GzGSkv7LN/nU8ERfSxRC6nyqQf6T4uPKMWcwfoBPSmzxk7m5N6rR41aQF6relJt9qSGLWo5RJhUOPOAuxVy/zRYv8sonJDQm6Y24V8JaTNtGFiO+XftYwUeuFuOdFZf9QfJmhgABkvE+JdDqEg9gX8lTDMZBT1aKlWZlyfoONvvmR0WpYSLYGnQyDz/+ToHkb230t65ieZZ3PIcHqb6jlRKw8FZTaHZlTZ0XESMjxuqHTua0nk31L5/K+n0LKxPvQG2EkbLpnI/Yp9IG7N7gAUMXOo9cQFeYcUl6FGrHoR+BcZiSgzRMvq/Fd0lXPLBTR3du0X6oGw/9rOlipvPgPMRdcCZSbZHB3N2MuZzcZ1tkJYd79+EZ90yQSJrj5WhyqSz2YCrwFSnhC41ilE5SxX8xdRnSM2BbGsHP4dHruzNmaT+YZuPXN5wVfTDCER1cLAm9e7NILhUl8LjOb5KPNPApFRhMn7+ICWvu8FGYCN4JMegMCe0VXMpGE1H93z0D2zMz6pc/6GAomvVP3sZaCtxInirZukmLc7owyMGutCQezp3O0YHwQguIt8wRSft X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exch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kfw7R4eaSP7LcyE6j1b7awJc83SaHdvG5sNHO0QrfDSAb4l1llwadCZk5z9iP3ex0PJkjGpuCzclBoK3vYe/bbP24nJmp7bYTysaazghHHBKLMa/VDRvD4uxWfh1MjVARC0aFXM5UJA4t3qv03iWiXDGMTTJl4OkdJBlCdU+mtA9o86M646nCXOG8KdtCbWctbaYiLUJsURqpAHHNeQ5h4XcFqfmoZdnh9MHpuOQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 45ce9e9c-f359-4a44-01f7-08dc323bfe80 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Feb 2024 17:47:23.5990 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8P250MB0117 Subject: [FFmpeg-devel] [PATCH] avformat/movenc: Make check actually check what is intended 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: wmB0VZuBhcyn Also fixes a Clang warning: "overlapping comparisons always evaluate to false [-Wtautological-overlap-compare]" Signed-off-by: Andreas Rheinhardt --- libavformat/movenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/movenc.c b/libavformat/movenc.c index afcee683cd..0855c4bb48 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -7160,7 +7160,7 @@ static int mov_init_iamf_track(AVFormatContext *s) if (!nb_audio_elements && !nb_mix_presentations) return 0; - if ((nb_audio_elements < 1 && nb_audio_elements > 2) || nb_mix_presentations < 1) { + if ((nb_audio_elements < 1 || nb_audio_elements > 2) || nb_mix_presentations < 1) { av_log(s, AV_LOG_ERROR, "There must be >= 1 and <= 2 IAMF_AUDIO_ELEMENT and at least " "one IAMF_MIX_PRESENTATION stream groups to write a IMAF track\n"); return AVERROR(EINVAL);