From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id BA8AD4B5F1 for ; Sun, 9 Jun 2024 15:48:33 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B159E68D62D; Sun, 9 Jun 2024 18:48:01 +0300 (EEST) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 24B4268D59D for ; Sun, 9 Jun 2024 18:47:52 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 82190240004 for ; Sun, 9 Jun 2024 15:47:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1717948071; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YwuBRNnaqYA7k5bGrar+c9zj2cQjplHR6LhtggzjFeU=; b=U/kYDwi99mYyE0YMW+euFheDTtAu61uIUO6Ekm1z4sNJtX3fcWjp5EzkMSh7JexL9ax7ot MThyTq7ODVmMFnZFmXQNVrGGmiPIzQ0xjpcSXln7lWvvOFiY5NvOObS03xgwX0818XcetC WkVlfktxkdv9VCbSky/KkGCKNClXdpqaRnuFd33bTIYagKNuWFjrAym1Q2Exp8SR0kPi9A Xpp+PxqcPnqTUPywvdBaRAjmT1UJU03ptyaT8GHJ0Pgysu2MYwmWMSB54x/THX2LQdL39N a8tk4ukYr6XuNKu0vI06Qn0Hm96YHFbt6ul5/4nD2LSg6eZe+EzghaBSHWffFQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sun, 9 Jun 2024 17:47:45 +0200 Message-ID: <20240609154746.4173264-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240609154746.4173264-1-michael@niedermayer.cc> References: <20240609154746.4173264-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 5/6] swscale/swscale: Use ptrdiff_t for linesize computations X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: This is unlikely to make a difference Fixes: CID1591896 Unintentional integer overflow Fixes: CID1591901 Unintentional integer overflow Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libswscale/swscale.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libswscale/swscale.c b/libswscale/swscale.c index 2795429b6c3..7fb24ee04bb 100644 --- a/libswscale/swscale.c +++ b/libswscale/swscale.c @@ -1173,7 +1173,7 @@ int sws_receive_slice(struct SwsContext *c, unsigned int slice_start, } for (int i = 0; i < FF_ARRAY_ELEMS(dst); i++) { - ptrdiff_t offset = c->frame_dst->linesize[i] * (slice_start >> c->chrDstVSubSample); + ptrdiff_t offset = c->frame_dst->linesize[i] * (ptrdiff_t)(slice_start >> c->chrDstVSubSample); dst[i] = FF_PTR_ADD(c->frame_dst->data[i], offset); } @@ -1234,7 +1234,7 @@ void ff_sws_slice_worker(void *priv, int jobnr, int threadnr, for (int i = 0; i < FF_ARRAY_ELEMS(dst) && parent->frame_dst->data[i]; i++) { const int vshift = (i == 1 || i == 2) ? c->chrDstVSubSample : 0; const ptrdiff_t offset = parent->frame_dst->linesize[i] * - ((slice_start + parent->dst_slice_start) >> vshift); + (ptrdiff_t)((slice_start + parent->dst_slice_start) >> vshift); dst[i] = parent->frame_dst->data[i] + offset; } -- 2.45.2 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".