From patchwork Sat Jan 21 22:01:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 2285 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp643648vsb; Sat, 21 Jan 2017 14:02:08 -0800 (PST) X-Received: by 10.28.154.143 with SMTP id c137mr7880725wme.34.1485036128143; Sat, 21 Jan 2017 14:02:08 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id f186si8325541wma.165.2017.01.21.14.02.07; Sat, 21 Jan 2017 14:02:08 -0800 (PST) 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 E221168A8B4; Sun, 22 Jan 2017 00:01:53 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-qmta-pe01-1.mx.upcmail.net (vie01a-qmta-pe01-1.mx.upcmail.net [62.179.121.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4D43468A89E for ; Sun, 22 Jan 2017 00:01:47 +0200 (EET) Received: from [172.31.218.34] (helo=vie01a-dmta-pe02-1.mx.upcmail.net) by vie01a-pqmta-pe01.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1cV3jS-0002qW-JQ for ffmpeg-devel@ffmpeg.org; Sat, 21 Jan 2017 23:01:58 +0100 Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe02.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1cV3jM-0001Yz-Ci for ffmpeg-devel@ffmpeg.org; Sat, 21 Jan 2017 23:01:52 +0100 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id bA1r1u00J0S5wYM01A1sPD; Sat, 21 Jan 2017 23:01:52 +0100 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 21 Jan 2017 23:01:50 +0100 Message-Id: <20170121220150.15989-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.11.0 Subject: [FFmpeg-devel] [PATCH] avfilter/vf_gblur: Increase supported pixel count from 31bit to 32bit in filter_postscale() 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Fixes CID1396252 RFC: Is it preferred to use 64bit ? Signed-off-by: Michael Niedermayer --- libavfilter/vf_gblur.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavfilter/vf_gblur.c b/libavfilter/vf_gblur.c index 27b702998e..f843e3f376 100644 --- a/libavfilter/vf_gblur.c +++ b/libavfilter/vf_gblur.c @@ -152,12 +152,12 @@ static int filter_postscale(AVFilterContext *ctx, void *arg, int jobnr, int nb_j ThreadData *td = arg; const int height = td->height; const int width = td->width; - const int64_t numpixels = width * height; - const int slice_start = (numpixels * jobnr ) / nb_jobs; - const int slice_end = (numpixels * (jobnr+1)) / nb_jobs; + const int64_t numpixels = width * (int64_t)height; + const unsigned slice_start = (numpixels * jobnr ) / nb_jobs; + const unsigned slice_end = (numpixels * (jobnr+1)) / nb_jobs; const float postscale = s->postscale * s->postscaleV; float *buffer = s->buffer; - int i; + unsigned i; for (i = slice_start; i < slice_end; i++) buffer[i] *= postscale;