From patchwork Fri Mar 29 03:23:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 47635 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9f96:b0:1a3:b6bb:3029 with SMTP id mm22csp1754563pzb; Thu, 28 Mar 2024 20:23:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVzKBH4gh6Cc1aQX33+DmcDcuuihc+vQ9ttl/ZIx3ai//H7UyofT70I9MtdeKxR14v913xK16wrALPSAx49fht1tf6RFBasLusoVg== X-Google-Smtp-Source: AGHT+IFnJkASBUnmc+J/HEA1QC0IJAH0Yy7Y8+8TQOLda8fOGiGl1mGtxUorpHieHsnjLTRAvy51 X-Received: by 2002:a17:906:e2d5:b0:a46:bbb3:f0d2 with SMTP id gr21-20020a170906e2d500b00a46bbb3f0d2mr615717ejb.47.1711682628042; Thu, 28 Mar 2024 20:23:48 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id he7-20020a1709073d8700b00a46bda1dbedsi1410050ejc.557.2024.03.28.20.23.47; Thu, 28 Mar 2024 20:23: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=@outlook.com header.s=selector1 header.b=cDpnQhpp; 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 2B21068D556; Fri, 29 Mar 2024 05:23:44 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04olkn2036.outbound.protection.outlook.com [40.92.73.36]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8CE8368D450 for ; Fri, 29 Mar 2024 05:23:37 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dm8KEL+blBt4+ms+yXns8n2HMAnPIL/DS9kOZD6awdgbMgZxtKm9i3iGXrZtMBarqegMHi13Sl8YzvdjILiIKN68N10Lsjshrl6M8DGFLTrmhdFfggXrFdZhQo3fTGBF6MH0i753dcvPaYmurQylIoVDQ/+VkZJuvRVXjfR0NCt+WYJFbaZ6E30VpT1SKZfTfMuC4MHkWXtRrsbckGpVkPDb1mof2QWAMyESAesB9vdZyYa8WmLsKR7QiYh94U2q26wfPb808kbsix4b4ZnRO/qe4D/KBFF7AQESQ+10n8XZd1Zsu9SRo9YinWY7YCX7NzYA4s5hWXI5Ddk2v6aBkQ== 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=Vxv2hqeS5+Ucxkf1TM6aOpdv/mV42xZgWLNb+7EssmQ=; b=F7A7zWVCI4ST/7ZfkSKiK993ObmQERh1oN9Zf3sCETtneZbX9GBACHpcX5F2SooSWuPbf0UiHADQaCCdPrSiTdDfLB1SEes09bxnxIM0Z0vuO5dyzhW2hguhXyXhyq9L2D9fpK1ma7BIvIBnMlZYD2SqLKdVNh/A1Idbo3+8HuHl3F20Wajy624Pj1ynELDtoYm9QzFahNr+ODq32QCG1RUoR0YKB2blmcIZuytX0jxA2HyBX0OQ+rQFkQNfR9IwLEl1/irtFJ61iR8skgsVMfq9grz1lYzTT0hQl4Gw3cgZ3M9aLUZr4K/scr+R3NB9auyvUo4JpG782B05vTS1HA== 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=Vxv2hqeS5+Ucxkf1TM6aOpdv/mV42xZgWLNb+7EssmQ=; b=cDpnQhppTBAAnkurbSSV0NNSWjPqbc3bJH9quAwrOIbEKqARQfJ2ZWJgeX5D4cFsYXzeOwWlUjDWj63C0RxqpcxpRsl0CDbUbQlhOltkPNszHiB+XJ5CAXRvvIdpL+NyQS03SzfvMq84lGT8/o9vzy6ag1YADP4rkuLDPmrSbnlay0uU0tWc3uQQRVrgq5ge4TzeI0TsFQEpkjJuSFiHM8opExJWE91jG/nnHYIg/jaEgYz/AXtfJ58JKfkp3q54+EorG9L3Vwa0upMCfiwWCNBer8WnXXDlu+brWmmMfuUIL37ei5j/hZoAXql/3m+yMnn7OLoSzxc9I9rWXiCKVw== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by PR3P250MB0116.EURP250.PROD.OUTLOOK.COM (2603:10a6:102:173::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.39; Fri, 29 Mar 2024 03:23:34 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::4a3b:cf76:cddc:c68d]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::4a3b:cf76:cddc:c68d%4]) with mapi id 15.20.7409.039; Fri, 29 Mar 2024 03:23:34 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Fri, 29 Mar 2024 04:23:23 +0100 Message-ID: X-Mailer: git-send-email 2.40.1 X-TMN: [vYOqzZglMor4Hwn6pMKCWRWetjcdyQeNLADiVpVxdLY=] X-ClientProxiedBy: FR3P281CA0140.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:95::12) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20240329032327.2304945-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|PR3P250MB0116:EE_ X-MS-Office365-Filtering-Correlation-Id: 2fd5e321-4c8a-45f9-bb1b-08dc4f9f9dc3 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aJZFjsZt/DKqlMujMlu4Y7hQ5yHMAjKsQGC2gamRxZjRriswsZtgwk6fDfFXOdRrCXqVryCtkvw/2jYhCxfs1cerA7ctl03vkQbp3UzhNvzhH+a/tNRcaiQrI8ipnM2KKbkH1gBq/xDpd9b0gHdXFxa2DPsVewEbPAx7LULMj36dqDeTCCKDGP0yJtXwNKZu+IdlsV0PLYS3c7HLWzxVxO84AkpFb4qyQRwm5762vFiqYz2B7x+VKfzgHDqt64/rcOJFGMEkuLSQgFchu7a89QpWmVfvkVEBsPzDWseeDRQ7Gcdsd5r7+oC2mHO1ku2AaSxIWyuqXTTO2HCJsR9S61wCrbcClbTjyVyHvyXMrv+4P4meKnNDXBTqAkri3zjHNovuoMyAYNltvhR5bdp2OOfcd1OAXRtvG4ZKVbgRHWaz11tXOoDAUNrUIpY10EDRS03Fb6sYOeiFXKRs0ETGGvRoS7LKWPPGtCqaEg9pa7gjncJp+eYP2g9IdwPco+eIClzJl7DxmX16/PJwDaBYX6GZiDJSnGNDbmPXqW8DsFRSC6A9IWhwBudUfqnyjaApSFfkZdVtwDg430EL8+5q0HoNxTnUu7tpSR9OcBSnnsXCXas1nFy7sIyDUntoJULYWweavd44DVzpERfZnR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sP350AjBmglnwRCxal8LlyA78qU3O9BPZ8TVJwhsqSaZ3Gn5R8pDExLIrmzmv8azRvvaK2+2yTqFRYJ2EcDThvQn0ekZ8/UR1NiobGkmxR7a0u+vX/3jaLrO7JFS8Xfh//HCVLIm4TnbzQyhv+UcXc0C1Mob+nvYP8CpNvYrEWKc3uo087fnMn9UjXlsRSkVH6C1k5oRehnBnFObKzJmC0LJOZBc0bpauZXYdAw9f2lVpMLdAjzLo0cFAm1XKvj/8gCbdMMkV3GSqlQM7Puah2cezL85dyXBwy/hCSLTS5H6Lmr4UOLyPS8ltVQjkHv12MzbQEuZQ== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2fd5e321-4c8a-45f9-bb1b-08dc4f9f9dc3 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2024 03:23:34.7669 (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: PR3P250MB0116 Subject: [FFmpeg-devel] [PATCH 1/5] avcodec/ppc/hpeldsp_altivec: Fix left-shift of negative number 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: bmlE0zrQfx2V It is UB and affected e.g. the vp5 and vp61 FATE tests: https://fate.ffmpeg.org/report.cgi?time=20240327083327&slot=ppc-linux-gcc-13.2-ubsan-altivec-qemu Signed-off-by: Andreas Rheinhardt --- libavcodec/ppc/hpeldsp_altivec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/ppc/hpeldsp_altivec.c b/libavcodec/ppc/hpeldsp_altivec.c index a531b6b6ec..4bf6b28ed6 100644 --- a/libavcodec/ppc/hpeldsp_altivec.c +++ b/libavcodec/ppc/hpeldsp_altivec.c @@ -41,9 +41,9 @@ void ff_put_pixels16_altivec(uint8_t *block, const uint8_t *pixels, ptrdiff_t li register vector unsigned char pixelsv1D; int i; - register ptrdiff_t line_size_2 = line_size << 1; + register ptrdiff_t line_size_2 = line_size * (1 << 1); register ptrdiff_t line_size_3 = line_size + line_size_2; - register ptrdiff_t line_size_4 = line_size << 2; + register ptrdiff_t line_size_4 = line_size * (1 << 2); // hand-unrolling the loop by 4 gains about 15% // mininum execution time goes from 74 to 60 cycles