From patchwork Mon Oct 4 22:23:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 30902 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a6b:6506:0:0:0:0:0 with SMTP id z6csp4757856iob; Mon, 4 Oct 2021 15:25:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzS2hCo4FHkx1Bwxa+44qaKTyw7XZXVEqGoPI0vNSMsJZv/N+spf3b6engqKJ1kI1NhBLp0 X-Received: by 2002:a17:906:585a:: with SMTP id h26mr19869705ejs.31.1633386304736; Mon, 04 Oct 2021 15:25:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633386304; cv=none; d=google.com; s=arc-20160816; b=0tpdT6zGMBb/UNzuphatBZDAfGMoibm/uldeMUfnlAB1H217vXgURBYZUzdIA5diqX PKi/g+jHQkjI1AaATyN/O4z4Vp4HFDbU3jxLjVj8x/fc6yJKQlTFN/utGO6aGAcqrmKq jagQgcJn9i+wyS/KC1E0beQb8LX95lAk4nnThBU3ZF7bWzsF7e5XNfo8YaVZOhZSPMkg 6tWnoPa97b93fKCmNANaEsKT0QHnEnswR5ch9JTbQBrrw/+IU/jaiI5K7A66wH+57ViY Konr+H/+Leu5QAzWdNitN2sIpLt5YbaI+aTuJDruDddJmhDkoXKM4EdI7bHMy+9v0eZ7 W+pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to; bh=2gQ9SmJkM6tESksmpetaUG6owH09MrYr3DWofYiwCnU=; b=fAl/vdgjjWLm1E+2npbKsNT6jZ/h8HtOngSASSabhKCZJgCEJ8vQK82luQSth5vq38 hV8vF9aW0+Cl8M0zbxoroCaLwUIIpdqpoCfxloCDAIZgzbT0aaCUqm7yXa8rML7Z3mGu NSuAGBxbeR4Geypt27/fFkokc9ADyVJDWHw6k5dxSERAzNNJCpn4ZbGauUNm7FTKwTHZ gi41ssEV+MGCrdHG30iicZDQbsQL6L1xD1pc8AzySlQk+l/tt0ZN74X4mxrHLFTgBNo4 9zLVHvOyEsN1btSp9kMM2vNbq1sl0xkHpSCt1mc10nxppJve+Z0EnxalZ8yWzBCVfEQD YmSg== ARC-Authentication-Results: i=1; mx.google.com; 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 z11si19406724edj.493.2021.10.04.15.25.03; Mon, 04 Oct 2021 15:25:04 -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; 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 CD36368A61E; Tue, 5 Oct 2021 01:24:58 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe03-3.mx.upcmail.net (vie01a-dmta-pe03-3.mx.upcmail.net [62.179.121.162]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E72D568A447 for ; Tue, 5 Oct 2021 01:24:51 +0300 (EEST) Received: from [172.31.216.235] (helo=vie01a-pemc-psmtp-pe12.mail.upcmail.net) by vie01a-dmta-pe03.mx.upcmail.net with esmtp (Exim 4.92) (envelope-from ) id 1mXWOB-007FAU-0J for ffmpeg-devel@ffmpeg.org; Tue, 05 Oct 2021 00:24:51 +0200 Received: from localhost ([213.47.68.29]) by vie01a-pemc-psmtp-pe12.mail.upcmail.net with ESMTP id XWNDmaeceljeHXWNDmAxqP; Tue, 05 Oct 2021 00:23:51 +0200 X-Env-Mailfrom: michael@niedermayer.cc X-Env-Rcptto: ffmpeg-devel@ffmpeg.org X-SourceIP: 213.47.68.29 X-CNFS-Analysis: v=2.3 cv=BoHjPrf5 c=1 sm=1 tr=0 a=2hcxjKEKjp0CzLx6oWAm4g==:117 a=2hcxjKEKjp0CzLx6oWAm4g==:17 a=MKtGQD3n3ToA:10 a=1oJP67jkp3AA:10 a=GEAsPZ9sns4A:10 a=ZZnuYtJkoWoA:10 a=NEAV23lmAAAA:8 a=f89dtdzFzDLL2Cpk5wkA:9 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 5 Oct 2021 00:23:49 +0200 Message-Id: <20211004222350.29657-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211004222350.29657-1-michael@niedermayer.cc> References: <20211004222350.29657-1-michael@niedermayer.cc> X-CMAE-Envelope: MS4wfMP/hXOIUMeFb5sbPFNqPxXUT7BAPs1Ui6UZ7Lwof6/L6S0GgCCCWr0XYpMd8c4IIBU9Z6geqdri3rf6KiQ+abCxT4WJ5qBuovhfTnvrrakAiYDyOEil gUs5Eb+ffVLW2EIa8xgCKn66x+PR6ulUDhWqbVlWuOfrEtyzVs9L3PAh Subject: [FFmpeg-devel] [PATCH 2/3] avcodec/h274: Fix signed left shift 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: NCx2gU8zxn9S Fixes: 39463/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H264_fuzzer-5736517629247488 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/h274.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavcodec/h274.c b/libavcodec/h274.c index 20401ba06bb..a69f9411429 100644 --- a/libavcodec/h274.c +++ b/libavcodec/h274.c @@ -145,8 +145,8 @@ static void deblock_8x8_c(int8_t *out, const int out_stride) for (int y = 0; y < 8; y++) { const int8_t l1 = out[-2], l0 = out[-1]; const int8_t r0 = out[0], r1 = out[1]; - out[0] = (l0 + (r0 << 1) + r1) >> 2; - out[-1] = (r0 + (l0 << 1) + l1) >> 2; + out[0] = (l0 + r0 * 2 + r1) >> 2; + out[-1] = (r0 + l0 * 2 + l1) >> 2; out += out_stride; } }