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 997D249AEA for ; Sun, 3 Mar 2024 03:47:45 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4AEDB68D34F; Sun, 3 Mar 2024 05:47:42 +0200 (EET) Received: from HK3PR03CU002.outbound.protection.outlook.com (mail-eastasiaazolkn19011003.outbound.protection.outlook.com [52.103.64.3]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 077E368D225 for ; Sun, 3 Mar 2024 05:47:35 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SZ2YNgyjZJC39VbDDiMGip7ZH6p6HHe5pkKw0D16hbv7QIMJXI1sEeLah7h4t3cf4S7QWg5iIIr5Y8suqf/lS6r1zc4XVmB26r/xYP/3E1YXLPIXgnQoinIf21rLV2HpwY3r2S2Ge3YLHmLlVFyFGM/z8dXwxCUMybVgmpyf7/c0Kl1WYt5TKqUSa2xwfFQn3Co6oqcUKkGtzVH5ls5DDD/0d58Vd8QyRY+rh2ibyyvbXmAFfMP99WeH/5TpPBo5sQvL2oPEzX3vS3o5MVRbbTWsP1g708zBiNmVpmXkMX0MRMj06iPwJBXhA6LIH3JgZSVuGekW6d5BoAMNqBBlhQ== 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=D7onT2Xp1lNkuLs6pvQa+XjHAwrZxp/S52pPDA5nUoc=; b=TTjqhV5g6WmKsG+9rkGmBvNMaFET8se8VyLNcJFkdouKBM2/bKUuuJ7P75HbmOKZYoRNGcsdTW7CTSuXm9undg/thQuzgVBDyBo2ONHnRxAlpeWN2a36ikQhpjI8U9NT/KOM7dUQFHVSbpGTW2hN2z63T0K9ZdkU7tTDJvM7I1lSeqHMN5eIf78d71uCYYRAKj/g7wSG67ynN5lcMcL4csqwA7Ep4s2czJWOwWbuFufoA5zfTPXZj7Ua0GtMrENpTrS5eiQcyv/sXi9qXoNwRF5gIqNUzqyLwCms+BdJLmdTrKLN7iOD8AAQ/OSxsXijX5d+PvgAfRST82dZH5gkAw== 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=D7onT2Xp1lNkuLs6pvQa+XjHAwrZxp/S52pPDA5nUoc=; b=icMzFCVrnVZTzoX/sjzTi2TngkTXl5uUC8bgdXLMeIt/nHCxi0hRedNjy+Fmj9BmWeJRuQbuMYlaODRpkAz6/Rhjxaj10QrRDu5cfvRoBBYrqY9qYhGAh2CyXbjDMrowUMe79EDoJreFiQIvvZSxn81HhTnK9ymPdqohWDnyyNx9ur1dbFH6W5P/LvwC5oqb2MC9Llu92vJ8xpL4ANwjBsJLq+hKddr3ofzP8fJSHPXdN+mZTt2MAxHX7vMccDDwPHFie6MFEEfYGKasJcVjirgz55v1nETtfU3tJmRcp5VaQfJ+Sd6vhXGxXZCHYLtcomsncITHDCSLLUvt03+p/g== Received: from TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) by OSQPR06MB7278.apcprd06.prod.outlook.com (2603:1096:604:29c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.34; Sun, 3 Mar 2024 03:31:34 +0000 Received: from TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::d001:da90:518b:ec1c]) by TYSPR06MB6433.apcprd06.prod.outlook.com ([fe80::d001:da90:518b:ec1c%3]) with mapi id 15.20.7339.035; Sun, 3 Mar 2024 03:31:34 +0000 From: Nuo Mi To: ffmpeg-devel@ffmpeg.org Date: Sun, 3 Mar 2024 11:31:22 +0800 Message-ID: X-Mailer: git-send-email 2.25.1 X-TMN: [i0gEnQjVUha3qY9wsDLLOWnF2rNUrAcG] X-ClientProxiedBy: SG2PR01CA0123.apcprd01.prod.exchangelabs.com (2603:1096:4:40::27) To TYSPR06MB6433.apcprd06.prod.outlook.com (2603:1096:400:47a::6) X-Microsoft-Original-Message-ID: <20240303033122.14204-1-nuomi2021@gmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 2 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: TYSPR06MB6433:EE_|OSQPR06MB7278:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d85f434-6669-4e0a-f9b7-08dc3b326b4c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fhHuFDwVIrkMUeiPcbx1qir7/yHfdLiFZQlzjSu4wLaX75+Ql6RUQbM2OmAzYXw8I/UX1Jlwteqibh4pYAiQRcPO8ieIWjWk7M08HPxzVA7eUeRVtgrIRVolX1b1Uoo63wSVVrrm+21ajfdTH6wKUXSA0fe/jW7NDtn9Q8gaqSMPKgK6YBkiKQupJavcbl/bDldbiaL3oqJdVQbmgKd6gENSJ6p5kwemdryk1rByTqKtbWCmv5Db8nwZXCLNk4KSL56LfPOMhld8/xAK3LPXcrOhyzcn5S6H8EZPdcSG1xTBnXHqSiov+2kHh/Kz9lKaNp6dier3Uv4U8DP9IXBWeR7eewA0Ued9f4gNBsSTMY9PNkPnWQMEdyq9inuaUAaos+GqbgGW81lFu0VEQweaNhXMDKz4teQUW9+v0/DNaGzETqrW3e6ksqMYztxQQcqUkxOzWB+AZw61TYg56eAWcG+SG2eYRl2qerIK75b+AA/W8sZspUvNk0ziBqbA6EOGKdxQh1nJ5G1SsE8XWnLsy05mkLFHnuvIihfg+VCMFlpJ+GBcmbi0Ll7PmmFzm33AEa25/u9QoWlVlQZ+YfQydF5S8remtpvudOln74DM8Xj+SwpYPeWSUl+uyZG5E2RF X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?itEhqlIjUhZod6BkD8xotQX+TTw5ibqeUEJjXzR2C0HCt893EX60ZqSpX7si?= =?us-ascii?Q?FAG2GW1IeLDYTq2UVbCJW3/Ye6FaGj6jWpQtFVn1FpjDu40OE0C3g1cQSJGW?= =?us-ascii?Q?6TInbTCu7rNUEfG69RVCUExBqYrEBEP0r2sD153Hhf1bWu2w9eTTO+Tdi6LL?= =?us-ascii?Q?Bs1xjT74QKlcFuJTP8/oPyZCV9rj98iBNcjfzo61Kha5jNi8lF6N4+C66kD2?= =?us-ascii?Q?745OEfc3JKDob55y9h+rUoX/NUYqy+6Nww23oof6sOUlAyXjjhY3PFAmW7w/?= =?us-ascii?Q?ik2AuUNezJot7es37pofp7smnzQ1mCzWxm50KxgB5KkcXYBCjxRcmPauUO9b?= =?us-ascii?Q?i2/ZiNZL51q7RiwdVNJVqYy87CsHi5O1u+4pBOUgpd5v4HSmSBGkkTnfHEmR?= =?us-ascii?Q?/NjoVUV14gi9rOc7YNMRHMzrkTvb4FpejlasuELocrfwPNieZRB1ZSnJU0Aj?= =?us-ascii?Q?xiUaQ3Fnt5cOGwkZmanNjTlcXh4Xb8UBHBtzdQ4/IGED6Kvq7K+WF3d7sGxJ?= =?us-ascii?Q?J0rtx7OnOFvbhZ2SF49+p85AABosNocdDVIxsOGlRlQOtsREVLGfPmBGrI9Y?= =?us-ascii?Q?IIpcTatUpB0Ek7Vv1LZUq1A0y4aFaJ94bpZahS9U7J9gxHmnIVwJU1TTaoZj?= =?us-ascii?Q?C1jqHR3SsZzRmUDcYjf6oXucsvWOacVK//2ZKET1neWN0GSkwZYo1u4I6PDV?= =?us-ascii?Q?g/jzKJuLp5ypFJcHMtlI/9wz80+vTBMxlovsG9LsQ1G9MyYjxLpuvnlAnkIj?= =?us-ascii?Q?G2nK4ecovEd+j5qi7+VRfgyB7R/HWGs1GN8H10y1ahJQ2sz2He6CpZiWsrQJ?= =?us-ascii?Q?d3qB2mkBa9Q5QYetdLtmBjIvDUjOW4a7f4swWN+FNJxv+v7Fnlo+/oK+NgZB?= =?us-ascii?Q?Etbu2OPRgvONBt6d6c8zEurnJNt+WlFM1f3zj4iLSCS1szPf50jjTudwoUoM?= =?us-ascii?Q?amieTgrmITPUdHv6zCxJeyGKObNYC3H2j41TTJWxCPMf0SSrln7cjLjGRqNF?= =?us-ascii?Q?rDkteuVhzg9GrFu/Cs/kovPGjK6HLavsYQAQVLU8i3xeiKfqcQdtlbvfzBuc?= =?us-ascii?Q?c7s0GlQgFHJ7gwdKjmMYGw4liEPe4SbFyE2Wnja5jOdVVUkl9FR0PUm9IW5t?= =?us-ascii?Q?TPAuFuM97xwod35BP+6XWZNM+IUQNAvTzO8YtAw6VUsqxuJbcpimCp15IwO9?= =?us-ascii?Q?r2BLUSHh2RHfFUbvo1m7XkSEqm312w5NWzmgcX5OoIVR3OvWtlU0lJXbrts7?= =?us-ascii?Q?SWT2d9g/on3C4pe3YG9WLWgmYdO6n4VczBQ0wbqZ5w=3D=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d85f434-6669-4e0a-f9b7-08dc3b326b4c X-MS-Exchange-CrossTenant-AuthSource: TYSPR06MB6433.apcprd06.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Mar 2024 03:31:33.3459 (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: OSQPR06MB7278 Subject: [FFmpeg-devel] [PATCH] avcodec/vvcdec: check pred flag to fix undefined beavhiours 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: Nuo Mi 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: libavcodec/vvc/vvc_inter.c:823:18: runtime error: signed integer overflow: 1426128896 + 1426128896 cannot be represented in type 'int' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior libavcodec/vvc/vvc_inter.c:823:18 --- libavcodec/vvc/vvc_inter.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/libavcodec/vvc/vvc_inter.c b/libavcodec/vvc/vvc_inter.c index d5be32aa14..48c566b097 100644 --- a/libavcodec/vvc/vvc_inter.c +++ b/libavcodec/vvc/vvc_inter.c @@ -816,13 +816,16 @@ static void derive_affine_mvc(MvField *mvc, const VVCFrameContext *fc, const MvF const int hs = fc->ps.sps->hshift[1]; const int vs = fc->ps.sps->vshift[1]; const MvField* mv2 = ff_vvc_get_mvf(fc, x0 + hs * sbw, y0 + vs * sbh); + *mvc = *mv; - mvc->mv[0].x += mv2->mv[0].x; - mvc->mv[0].y += mv2->mv[0].y; - mvc->mv[1].x += mv2->mv[1].x; - mvc->mv[1].y += mv2->mv[1].y; - ff_vvc_round_mv(mvc->mv + 0, 0, 1); - ff_vvc_round_mv(mvc->mv + 1, 0, 1); + for (int i = L0; i <= L1; i++) { + PredFlag mask = 1 << i; + if (mv2->pred_flag & mask) { + mvc->mv[i].x += mv2->mv[i].x; + mvc->mv[i].y += mv2->mv[i].y; + ff_vvc_round_mv(mvc->mv + i, 0, 1); + } + } } static void pred_affine_blk(VVCLocalContext *lc) -- 2.25.1 _______________________________________________ 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".