From patchwork Sat Sep 28 02:26:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 15351 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 49821449F5A for ; Sat, 28 Sep 2019 05:34:10 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3AA6768A5B5; Sat, 28 Sep 2019 05:34:10 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E3FB8689A24 for ; Sat, 28 Sep 2019 05:33:58 +0300 (EEST) Received: by mail-wm1-f68.google.com with SMTP id 5so7796184wmg.0 for ; Fri, 27 Sep 2019 19:33:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cWVxmzv8v3Zzsn2sXhGtUhpNCMaWAKRfv571fDV57eI=; b=iSoJ1yl6svNjVUXm8OtgEW2xEkd0Yoc7G8g4yOD85CsjbNVAgMWIaNuHSAa2vVNJGm dNRzAVWT+N9xgMmYl7oBk/Pj68CtBJDEqi0GDxZyaVTDPfdebPOscJr+ZSA8e9505D/B /ppodbr0FSs3OObrmEb69sJ3Z/Tt2op/niJ3gFvoyKI2Fts772gSJNFNHtwetOzXK6Ma UKYUJBEKwOBUN2ZtEsCikMGNmvijZK+zmLC7Vq1T7kFILiCGuTabpuQ9nZjuX4vjn5gs BOq3XBJQGtnmt2w7WORVggNvjAp6LlH4AjnzbFsQuRYc9sz7H43j6GNnqsHkSJa5iiMs krrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cWVxmzv8v3Zzsn2sXhGtUhpNCMaWAKRfv571fDV57eI=; b=QHTckiOwa64wrHWelVzh7x8qosF6weuu2CuxpfvjKhbk5ZeSCT5rx7ds+SugOREjLj 3N6f3D2aI/M/3OIlWQyjTe2NG6oW/52Bmp6HPjOKsRpAtggegEXV7tHtPLX/o27CZ+nT 9WJOyq/rBPRFTPCDAadYPsrFYF1fqBJ9wsXgc14eZb05W+9lFYuzlw1fiCDn8UafByvw aAjtZc01oLlhs0O47lGQLdrkIkzkcL5UVeYlVL6HDXiUvK1yFY4hK2O3Vmr/LihxbfFj b21BJcwh2S7mH0Fgu+aSERjjtt2zUXf395KuQ8wYcqFsMyI6W1AUIldKvjKrNOFN6ui5 S9ZQ== X-Gm-Message-State: APjAAAXlID1KJboTAUwn6c5tVxcjeh2/obPpL98XqhPmNBOUogalt90C cpsDlTu3csOlSef/Lk2j7CX7XZTv X-Google-Smtp-Source: APXvYqx0LiH++uru7KPnUZOrYI++f11x612Kd5OAAg6d0yWgJMUNLLozQDrBI1j3Rw785wlHm8Gqdg== X-Received: by 2002:a1c:9d15:: with SMTP id g21mr9505908wme.96.1569638038330; Fri, 27 Sep 2019 19:33:58 -0700 (PDT) Received: from sblaptop.fritz.box (ipbcc0f857.dynamic.kabel-deutschland.de. [188.192.248.87]) by smtp.gmail.com with ESMTPSA id r7sm4484231wrx.87.2019.09.27.19.33.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2019 19:33:57 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 28 Sep 2019 04:26:02 +0200 Message-Id: <20190928022610.5903-7-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190928022610.5903-1-andreas.rheinhardt@gmail.com> References: <20190928022610.5903-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 07/15] swscale/utils: Fix invalid left shifts of negative numbers X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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" Affected the FATE-tests vsynth_lena-dv-411, vsynth1-dv-411, vsynth2-dv-411 and hevc-paramchange-yuv420p.yuv420p10. Signed-off-by: Andreas Rheinhardt --- libswscale/utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libswscale/utils.c b/libswscale/utils.c index 1b1f779532..57c4fd2b0f 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -390,7 +390,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos, (*filterPos)[i] = xx; // bilinear upscale / linear interpolate / area averaging for (j = 0; j < filterSize; j++) { - int64_t coeff= fone - FFABS(((int64_t)xx<<16) - xDstInSrc)*(fone>>16); + int64_t coeff = fone - FFABS((int64_t)xx * (1 << 16) - xDstInSrc) * (fone >> 16); if (coeff < 0) coeff = 0; filter[i * filterSize + j] = coeff;