From patchwork Sat Sep 28 02:26:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 15353 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 6EA3E449F5A for ; Sat, 28 Sep 2019 05:34:13 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5124468A63B; Sat, 28 Sep 2019 05:34:13 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7322768A4F6 for ; Sat, 28 Sep 2019 05:34:00 +0300 (EEST) Received: by mail-wm1-f65.google.com with SMTP id r19so7773533wmh.2 for ; Fri, 27 Sep 2019 19:34:00 -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=YHyQ8R5THH2hx7PeDLEbiMwKfHkBEECZW2Q4GyGtv+Q=; b=E35f2YNGIp5JyeoWIYM7+JqzgGVdcABYaxzmQEhtAakOgJRx9XLqvN2dFFAnjbpq+s YsOI5avx1ImrkmxgydRnTxnF4Yh2vMq5bCOWIcQE/DDwaJu9WR2exZqVCvbV0E8K/f/g a4GdfY2JO3vHmJQhc7+BU7gOsTqhPMvPK8fWXGHKyOoZnEEkJkRnKVYWHuVGr5qSkpUh hmhcO1Y/mllERYXnZ0ElrmPjb1KAXeqEczM1wQ9gc5fdQsvfU/8hIH21DAP+0uZ0n/Kq YcGRgQCHQoeTs7GfoubovmqIuLGGmiy9y1quDQZJh/gMeGysHEQM9g9auOfElx5M+jog eR4A== 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=YHyQ8R5THH2hx7PeDLEbiMwKfHkBEECZW2Q4GyGtv+Q=; b=BMK6h5blfK832R+Tt64iYN1q6xWmhH91yGorGJ0KUBoaCsYYnCy6LJNK2BckaT/rRF v8Gv+ab+VwU0ZOrg9zExO/b6P02y01E7rqQb755taM/dv/OptnR8hFPhogf1+gQQjJXf 1fLNTa9NGP/HLgOZ3T5gOJEjIU3sH5b9mJDcEf8xTKHNlUrFTf+1v8W79oyyKA1Cw3p4 zH/sm1dvq4X8Z9cjQcXnNe494da3KPCCYUZLtMR5qsGgx1CTtAf1vqcgWP8SBs591FC1 yYOhDS2j0DumRk3gxdAHjldP7b+TcvtylsnwGmGHHSvSKlwdkGCPyJRIlJgO478Fv19E EpVA== X-Gm-Message-State: APjAAAUhFeTkWFHGTp5sZCYznZx894Zk2KmorgsP80y4eMSCDsrs9ZrE CvKCRNYDpyKj37oZr+b6riFx5TCS X-Google-Smtp-Source: APXvYqyg7vyRfbpJqY83A0n+A2pTK1P5NUiF7D3JSbKrd5AoiZPnwTFJWLZWO6VT47LtKxNUbUWlmQ== X-Received: by 2002:a1c:23d7:: with SMTP id j206mr9059903wmj.57.1569638039876; Fri, 27 Sep 2019 19:33:59 -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.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2019 19:33:59 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sat, 28 Sep 2019 04:26:04 +0200 Message-Id: <20190928022610.5903-9-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 09/15] avcodec/vc1_pred: Fix undefined 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" Affects the FATE-tests vc1_sa10143, vc1_ilaced_twomv. Signed-off-by: Andreas Rheinhardt --- libavcodec/vc1_pred.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavcodec/vc1_pred.c b/libavcodec/vc1_pred.c index e1ad0e1d7d..08412b3435 100644 --- a/libavcodec/vc1_pred.c +++ b/libavcodec/vc1_pred.c @@ -191,10 +191,10 @@ static av_always_inline int scaleforopp(VC1Context *v, int n /* MV */, n >>= hpel; if (v->s.pict_type == AV_PICTURE_TYPE_B && !v->second_field && dir == 1) { if (dim) - n = scaleforopp_y(v, n, dir) << hpel; + n = scaleforopp_y(v, n, dir); else - n = scaleforopp_x(v, n) << hpel; - return n; + n = scaleforopp_x(v, n); + return n * (1 << hpel); } if (v->s.pict_type != AV_PICTURE_TYPE_B) refdist = v->refdist;