From patchwork Wed Aug 14 01:08:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Almer X-Patchwork-Id: 51006 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:a746:0:b0:489:2eb3:e4c4 with SMTP id f6csp618144vqm; Tue, 13 Aug 2024 18:16:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXabSjD4WUp9IbkNC0EF89+DiDXq0i8Neq3jwVWM5hK1P18UDuTWJmxzB85zy9mVCPTHYXY4P15bMBeNR3/sM2j@gmail.com X-Google-Smtp-Source: AGHT+IHaIayxmTeIeufwsxhCTSClMEaS/keZJwoJ4tfqLwLERmyWF6sAfst9zNDpmo3oNC5NGeb0 X-Received: by 2002:a17:907:da7:b0:a80:b63b:eba0 with SMTP id a640c23a62f3a-a8366d56694mr41867566b.4.1723598172861; Tue, 13 Aug 2024 18:16:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1723598172; cv=none; d=google.com; s=arc-20160816; b=cUjJHiJ4fWfzyQgk0pfy7REi0qcqGIJhD/h2M/mWKZmoNXAt4ZNnewy/qk3gKMh1Sy Gaz5l7Czm7Eejzxk7MH1MEYmbOM7omAolUPXjWw+pbVNO4ZXfKqaUcP0D3/NvBE4hNIk hlfh7VkzlqN+HsHgMVLicgJ1BvZVqihHc9EhGlFJSI1aRdEIg76VIxumjdgx9RbDEHBO gF/mWi8QT+JPxoaTTcbq6GCh9aLOZ8/jHG0szoKUlw2dX6pU6beeelP0N4amiH46jE0f 9y98xaZs8zP51OJSrskzoRndiKMfxlxZLUli/PTcpJuy3J+quqQxRR9swaxIhiRAMPYr QqPA== 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=8IPaKRw/OKAEI8JhMtrhw4Xnomy14kr4h29QvXbzUbk=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=DBjNfIxihqeOcMISt8TN5evQ3gJ1BQda9X33vBuuzq2zd6lKwfk5i/AXp5ae78rY2t FwrQzs7q7xfGScslW3c5ATTbT0+1r81sJ1JD6B25bIVyG7CR84VyRjzKi+zbLHiDBRv4 9wr54IS3aqT8I7tGNeXe+ZltDMIXFLTVQATiS7+lgbSFiVc9NSZb6O48+MVw56nbTbfB iwD3qD/2ue5EH3Mqg8t0QIhvcri2amhQbF7G3oezNPw7xEx2AO4U0LvABn4Fc8T6T+gk ClCwbW65wn+1ck2ESsnpffUpdNxwtP1Z1xty/a6LlgwbuuicOURQHYrJFxry/b0FQ9kG Ps+Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20230601 header.b=ILxz87Kp; 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=gmail.com; dara=fail header.i=@gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a80f3f4ea36si154704866b.68.2024.08.13.18.16.12; Tue, 13 Aug 2024 18:16:12 -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=@gmail.com header.s=20230601 header.b=ILxz87Kp; 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=gmail.com; dara=fail header.i=@gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 530B168DA7D; Wed, 14 Aug 2024 04:08:33 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3E21B68D582 for ; Wed, 14 Aug 2024 04:08:27 +0300 (EEST) Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1fd640a6454so47237765ad.3 for ; Tue, 13 Aug 2024 18:08:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723597704; x=1724202504; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=XnRFKUyaw2e1GcM+QzLWOWOMadSNnWzBnkpgO3unK0M=; b=ILxz87KpBSuZiLc/p5LoAkrsgki8f8cniDFdGvzBW7mEf9bNnXfW5uhTpXPj5Oy8mN BM8Fj/kw84avXO9MPTT9BEZ0BZpLnnawqhLVSm+HHBsXhIKgrQKHGDbqfOkhPm7yETi8 sC/b2hzj/Elq9r1zu/F6T6EusxM6RJfPVD/jslSrlRwLlo9fFIgOmuHrw7IOC7Py4a6e wpq+yY+HlUfieToxtMFGWo8M0cmietx8MxvIX/izlxb7ku+7ypFn2i+jk21P2V+ZuVG0 UQYcRlZNqLa0YL457JuI3EPfX4bnI9DElXecYD3QE7LMx7zsVfd5TYuSmiIxt/1W0mUS e7sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723597704; x=1724202504; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XnRFKUyaw2e1GcM+QzLWOWOMadSNnWzBnkpgO3unK0M=; b=t6jgAm8h1MxnB20F5HDkfw+ebMa5R3YPXVhSjo6gxSscUPZSn/gK0rgzKsUS6bGGdk HZUZ6+6sBAI/r6q7Rq4KpDROzy3OOYfDrqvTzUJexhb5cHW6t4wm8pbcsJ7kqO9RRsXb 4i/Mz+xtL0nzHgUqTxPVrxzn4EDL30keQ70jNEnEb/5LhhKIO2T083SgdJq4HjxrC+z5 Ia6HOkWZegKhVMfPUIscPxvRKzxUi7DuLWWxZhaZ5vqxvVdnYBQmD+hYEkgN3OAdSEkx LUoszx+K/5WjJ+l5yDhwf6V17QHz5PbZDvl47hxs6Dbo+GAHxR2d6xH5Of6BJXlF1pxt VZYw== X-Gm-Message-State: AOJu0Yxr01OAPHLPJikhfjcQw4lLKfA08QfRgSD86nPqbheahEMwixBe jaZz9cY09liZM3LfsB0mKY4ZJB6IEDd5TqcjuQr4GThBABhtonIZVmxpBA== X-Received: by 2002:a17:902:ecc5:b0:1fb:3b61:45aa with SMTP id d9443c01a7336-201d648cfa0mr17578505ad.40.1723597704047; Tue, 13 Aug 2024 18:08:24 -0700 (PDT) Received: from localhost.localdomain ([190.194.167.233]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-201cd1a9eabsm19370545ad.160.2024.08.13.18.08.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2024 18:08:23 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Aug 2024 22:08:29 -0300 Message-ID: <20240814010829.33436-1-jamrial@gmail.com> X-Mailer: git-send-email 2.46.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] avcodec/snowenc: sign extend a variable before shifting 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: M4BRe5hf2gqH Fixes "libavcodec/snowenc.c:718:27: runtime error: left shift of 8509032 by 8 places cannot be represented in type 'int'" as seen in fate-vsynth2-snow-hpel under ubsan. Signed-off-by: James Almer --- libavcodec/snowenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/snowenc.c b/libavcodec/snowenc.c index 0b87d751b8..eac81d0d7c 100644 --- a/libavcodec/snowenc.c +++ b/libavcodec/snowenc.c @@ -715,7 +715,7 @@ static int get_dc(SnowEncContext *enc, int mb_x, int mb_y, int plane_index) } *b= backup; - return av_clip_uint8( ROUNDED_DIV(ab<