From patchwork Tue Sep 24 22:02:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 15266 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 0975E449BE7 for ; Wed, 25 Sep 2019 01:03:45 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E60FA68A2A2; Wed, 25 Sep 2019 01:03:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 85E88689DA5 for ; Wed, 25 Sep 2019 01:03:37 +0300 (EEST) Received: by mail-wm1-f66.google.com with SMTP id 3so1904015wmi.3 for ; Tue, 24 Sep 2019 15:03:37 -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=rn5Dp65pMbRkmwIClN9SvJsOObr5w93hs1d7XuBO3Kc=; b=bhRs1IF+M5zBMIMhDeTDTs4A0F20Q9o4xYvTSOqkw6zX3/72LxaxZ7N6iIGt92nsji 3erXHTWlX/56N9D+kJ/PacD0Htq1Qf4ElVmGK2dgYBAj/j7NuUg8ykeyztlPc7sz3a+i v0JjV7z7BFkmLwdE1hlJM43q6mIgETsgdKoYnR6PuvQBNpzhBHHZE+CiG1frlLqQdLsz AsK8VgdeiCjptJfAxmuUA9Ik6yOe9C91By4W7lRDdSpdkglORMz+JGsg/MGdL9SOnMlM r0JEDI19x/VrmvYrHh5ghRZ5LhohrTOWC09MtXu6IyaqAiCbVHRQhwtun/eFGjjOlIeC Bqcw== 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=rn5Dp65pMbRkmwIClN9SvJsOObr5w93hs1d7XuBO3Kc=; b=kZHUYnSKf8S3glaFT/rOVhGyxjh+4IFh7m8wmM32KLJY5ANniNdFUvfXjMNdSiYTuI FmlL5XA5RLie28R2OZy2Els7NdCCsv3wlAuUrHbzPLOJxwGr6V+Jp6Z/+eog73RqR43X 8HlGBZk/u1xSFOQ504GqVcxiFXJbA81qzZMFuZdtziQM1Zya++10t3jlJqJ1m+x3nrw1 yo7DBC4DfzLhWpmcfQS8r6rCjwzqIKLyAudhpZF3lfqv2UBKmxhFEEY1sI5ksZMTpZW9 wiVNfx3B4n7S8V+ImNlrkV+U5Uw1W3S7Y5t7GYYSSpEhX3PlEn2/sZkdylOYtOYnvujx fPKQ== X-Gm-Message-State: APjAAAV+p3D1N2xsqHtUcDBggMZ7AU9sy4f5STogH2YzheRm+SK2x3oO IsEr6LoiAntQLt2Jj0kLSn3PL64L X-Google-Smtp-Source: APXvYqzBFCDOA3fx2mnd8wr6FShio6/p+DqlMe4UjaowkihHDtoEYd9LKY6WV4VAv2eCsV3qM6t9Pg== X-Received: by 2002:a7b:c92b:: with SMTP id h11mr2924810wml.10.1569362616656; Tue, 24 Sep 2019 15:03:36 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Sep 2019 15:03:36 -0700 (PDT) From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Wed, 25 Sep 2019 00:02:59 +0200 Message-Id: <20190924220310.31157-5-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 04/15] avfilter/hqx: 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" Affected every usage of this filter; in particular, it affected the FATE-tests filter-2xbr, filter-3xbr and filter-4xbr. Signed-off-by: Andreas Rheinhardt --- libavfilter/vf_hqx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavfilter/vf_hqx.c b/libavfilter/vf_hqx.c index 16a1be7bd4..ddf8f01e4c 100644 --- a/libavfilter/vf_hqx.c +++ b/libavfilter/vf_hqx.c @@ -523,7 +523,7 @@ static av_cold int init(AVFilterContext *ctx) int startg = FFMAX3(-bg, -rg, 0); int endg = FFMIN3(255-bg, 255-rg, 255); uint32_t y = (uint32_t)(( 299*rg + 1000*startg + 114*bg)/1000); - c = bg + (rg<<16) + 0x010101 * startg; + c = bg + FFLSHIFT(rg, 16) + 0x010101 * startg; for (g = startg; g <= endg; g++) { hqx->rgbtoyuv[c] = ((y++) << 16) + (u << 8) + v; c+= 0x010101;