From patchwork Tue Sep 24 22:03:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 15269 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 09F3A449BE7 for ; Wed, 25 Sep 2019 01:03:48 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E309F68A3A3; Wed, 25 Sep 2019 01:03:47 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4B3D868A24D for ; Wed, 25 Sep 2019 01:03:44 +0300 (EEST) Received: by mail-wr1-f67.google.com with SMTP id r3so3798283wrj.6 for ; Tue, 24 Sep 2019 15:03:44 -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=XXOz6vvvW8VfW7Mw/rRp4PSOVg+OKA+lrzWjI54k/kk=; b=gUm0o9TPzh0tCAegTo2CSy19ZZqgjbon70BL+VTsSHP1Q2kJz+Hycc7cBCdmiCALLy EhWlaAx1fmv4GfuhHxKhbAIE+9cUwAXWv23UYVBf8xW4DqneKToHMmKmivbjwBSQSfk/ pGRw4LAJM2R8IgEFWilUwt78nxalQbBYpUVJJF1y4OBPNbHipx3gV/vOJDfFENjibkHu EzLo0axFo8QcL0W8EPsKv4/pp1GWO1Trj7+E2PBPnw45VuHvN166oh9XU0yb6eHK/SHY xO0/o8w/Ly8YCrzFINFjSw1ij6ggov1+ko7UuqujGqq4Ewl0XnU4ER66bWiXbBPANfTj kZng== 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=XXOz6vvvW8VfW7Mw/rRp4PSOVg+OKA+lrzWjI54k/kk=; b=aCd5CKkS4Dq+KZx+A2mHiVlZSdaGb5sryGJqGYr0jATvCCKFwJCYZZVKEi2lq0b/Qo PU9AUUHjhYwppAuViMuLAK3quug/OaKqGpk6oKBF7RsyrZDprOJPFi7lLrjcwXndFkzg xZVB2OFcgK1Ahp3XWmqVcwyjKacnRsdg2F0vIbU+ENUQ/TIOs0MSNRMqvjDx4TTwIP5j Nm2IeYcYs2OGmpuIfFW7IZ42tETjkFEOWG8c7gZzs7SVmIcd0ImgOncSOQD8q2CaJUhp N/xCUtwIse5DilM7HI3dTD1PFPIZEyM8xkb6DUhzgZzbPWrpY6Y12KADtvUWa4UIaZtk 1Uyw== X-Gm-Message-State: APjAAAUYtyFHaD3Z4j3tphmuiRSQodOHrPo93WsAW56MYGlgIcOpCFVB FBYlLRJs+V10dCovzN7vlsJwr0OC X-Google-Smtp-Source: APXvYqyilS2u4SAw6O6rDOD/mdXammU7mOj3+68oLzkjv+NxHhudFqoiNwFISy4zif744cYOijxtaQ== X-Received: by 2002:adf:fb11:: with SMTP id c17mr5241256wrr.0.1569362623571; Tue, 24 Sep 2019 15:03:43 -0700 (PDT) Received: from sblaptop.fritz.box ([188.192.248.87]) by smtp.gmail.com with ESMTPSA id l1sm3023808wrb.1.2019.09.24.15.03.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2019 15:03:43 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2019 00:03:05 +0200 Message-Id: <20190924220310.31157-11-andreas.rheinhardt@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190924220310.31157-1-andreas.rheinhardt@gmail.com> References: <20190924220310.31157-1-andreas.rheinhardt@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 10/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..4249e0bb78 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(FFLSHIFT((int64_t)xx, 16) - xDstInSrc)*(fone>>16); if (coeff < 0) coeff = 0; filter[i * filterSize + j] = coeff;