From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id EF97C4556B for ; Mon, 13 Oct 2025 16:21:38 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'gi5C+Sz4ATwtv92gNzfLqzETInnP8icWfk60mNe43nc=', expected b'YDD8PpvO7B1d3P142t2jF6I4pC6V99HORKrM3k/KDcU=')) header.d=googlemail.com header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1760372482; h=mime-version : references : in-reply-to : date : message-id : to : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=DIRDeHfkeOvneN2lgyuIAidCHBt+tNQizOqjr65qjXU=; b=UdpHYt7OSFnAQzFkhhJto714Nrqzjnd0aldjbHf+rrRjb8zwbTZ95poefmP7xB6BbaQWr PYRohuXB9foHu4COl55l2LNypCuNeXdi1ntCQljhtq89WVDBK360vO2jRmIR0lfLSn/mXla /dKLVdPfn+iMfa4+tuiw5/wbs/UN2xAL4+dzoUCLVVpOWORX7ruIa+GLVGpMbM4PKCvf48T DSkTjNEiB2NcavrIxUucKN3xHSam4ZuSy7oHWi0ddBCyKUgJM/xh/F1AiCxLPqt9l1I3ty+ wel0+b9l9Xs1HijCPEgTPvVuIjhlV5y5N9urY4DJT+kGs8AFqpOfmQbwvwEg== Received: from [172.19.0.4] (unknown [172.19.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id C777F68F205; Mon, 13 Oct 2025 19:21:22 +0300 (EEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1760372479; b=jf+4GqlEeBqW1e8BvUR/IT8MPxDiCOH7KGkfq/03iR74SpVfupEARr0Oi2q3Y8i63h3Xa YtbyMJIYlVZ3hS+nqNEadL5lzDVBr241ojCbbtcWoYzLwwMF5M7L+hJ1LyFZcf0nS1EUYls cxC4aDe5r909lCho3btcU4U5Lmswx4RU/TPYOXpkv8Lw4IgjLl3/WWoD4yKV2LSAqrb+Kls PkktBtpJhHTCstRjNTvnrk1kUyfxmXuLw18sefoqRex8EgoTntZntkZxZ2TmKwJR7viz+7F oGU329AxBKaViR1ydpOSAi5FQU42EwXZCPKoaka5bi3x+av+F2gdJWn/GvZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1760372479; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=gi5C+Sz4ATwtv92gNzfLqzETInnP8icWfk60mNe43nc=; b=HElQPLasWQqr3F+0XA4jK0IKy6YqNZqwJkuLNR65N7TpXSEQXkal6Zgm3vLGtWLUja2OT uAz4aQ5HZxEiKK1Bbe/e9NLUOayC0h2MTGX6vKiVEEloLzzUlqwb2TuJ/dCWIRRQY8n2cO9 Yn8NK7++RE6kXt+eQ76HmxI6VI0wAevl/ELTSQ+h4Dj8/bRB0Q/vakExMghKOWWgPTXCem+ nn26Q7mDZ8xC8itLViNepRn7K8Sa/ES/Ej2VCiBE89IcZKSIhruOHNWIbioyPTmlzTjhbad xWbdYKAqSV48rBcF4KWUbtngXYw9G07n+t1YIjaliVDkeDfb0EvnuFzKaQEA== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=googlemail.com; arc=none; dmarc=pass header.from=googlemail.com policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=googlemail.com; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=googlemail.com policy.dmarc=quarantine Received: from mail-yw1-f175.google.com (mail-yw1-f175.google.com [209.85.128.175]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 52EDC68F1CC for ; Mon, 13 Oct 2025 19:21:08 +0300 (EEST) Received: by mail-yw1-f175.google.com with SMTP id 00721157ae682-71d5fb5e34cso61101057b3.0 for ; Mon, 13 Oct 2025 09:21:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20230601; t=1760372466; x=1760977266; darn=ffmpeg.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=YDD8PpvO7B1d3P142t2jF6I4pC6V99HORKrM3k/KDcU=; b=NsGxPeHuxTplFISjge1P2oWoBTDnNIIR2q9NTSDZ+wcm8YkT+WV2ENL3cn7Qdm6OEt y99se+P2/NrFVNmZtB99r36JUYx5x3mgJ3QQnnXkmecpE6+uIjRigNHt61nwpgzd9hKt CJpW9a/2jPdysX9/ZN7AEqhJDUhOKtGxV2+sX6MAGYv3MhJOA4VpV6GTRPsOni7Mww/0 liJSlDgr4QricXKK18yvolFIxsEMtbOU0/5MaWyoNerZ6ppAhXTQ3b802Tkk6QucSB2t 37G0qV5yJ3MnMrzls4M6lDJxAVAzKEaAnr71OEx6/FsxBiTAMwOMlm8RKI/rfhx9rAqi udPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760372466; x=1760977266; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YDD8PpvO7B1d3P142t2jF6I4pC6V99HORKrM3k/KDcU=; b=fHIxf8YZ/LgAfUR3wu7VuBxjAkypRtskUZDWLZ2wwELT/OGJu8eMwBl5xmqItZ7dMa tzAQ7ebxFKyQdKyCDGN5z+MRBPZPTu4O9yv8Q1kr2RSCnzADPC+EqA+NzsItkNwu+9RZ fr/Csdjdw1ZEkMig90qrfLKfnFBUeQmgr3CUH20lfnU0GRPdmwbHqDqxsPb18aOsN7UW Au+UoyFx4zjgn5GrX3QVnZsvhRxCG0kemzUVG2xq4pV1rB69/A6Wkk0v4zF5hdmlf7+v xmvNxbp4KfdBG3VoAWG5yGZeyOdMpn6qtgxx0jNLJhnRaISYuDq/m1yHNRKX5FnStEfY 0i8Q== X-Gm-Message-State: AOJu0Yw+B/FfrF4i68CcnprDO4Lt333215nhSChVH+G6C1EbHGYslwWQ BnqTgKeDmsqdGcmKNfLi/u8WsXbG6KdBPq0PRvps3lbPyrG7u9NYmw6HiRjqCjBD3AW+s/2QLSS 2a+VzDHSoirr+ZPqW+pXPIcQ2bWjlO6keDcGUzjE= X-Gm-Gg: ASbGncuzHILz9GjEg16bAyj4bFOQETE4INI2lHTGbUbsUgvNtYZ6iqe8/05HPbHTdcC ZWwRKduvVX/tVcGcY+bTloKRce0j8MxiiqzxPieZax4hEe/eZq+rSHoEGaUQQD5EKWs17uwgMFK OUbIRybPgKBgluW3z/NAb7NiKRTAFM6z11cjs0ytciDoGzr0M9FDk7amYRXtMWK1cd+0NoIwr0T GM2jybxMzJkJqwGFKOAayVFkn8dxIfUOqCXEBW7Dr/dWHEh6wlLPA6j/DprrxYw/Hg2tIstzeP9 XRcSN8rUQmh3Z+mYPIrR1ybAKw== X-Google-Smtp-Source: AGHT+IHvxnz1DWarduxWLlZ9+DaYKK0vV64DlqDMc4TXT5pltFX49eSOFaI9WBq5M/zm8SFvtJ+NMvnZ7PVPdr+odj0= X-Received: by 2002:a53:c041:0:20b0:63c:eb82:6d38 with SMTP id 956f58d0204a3-63ceb826e6amr8959021d50.7.1760372466093; Mon, 13 Oct 2025 09:21:06 -0700 (PDT) MIME-Version: 1.0 References: <176036206413.25.15905318861432080946@bf907ddaa564> In-Reply-To: <176036206413.25.15905318861432080946@bf907ddaa564> Date: Mon, 13 Oct 2025 17:20:55 +0100 X-Gm-Features: AS18NWCybkFA6MEIJ1yRJWZ8aaDRG4QyeIwh8zvIkk-bCh7PjwFmjo4lQJ-xp_c Message-ID: To: FFmpeg development discussions and patches Message-ID-Hash: CG6T3BRMPLP6CG2BIUF5MJM7XWHUPSG4 X-Message-ID-Hash: CG6T3BRMPLP6CG2BIUF5MJM7XWHUPSG4 X-MailFrom: SRS0=+CVt=4W=googlemail.com=kieran618@ffmpeg.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Content-Filtered-By: Mailman/MimeDel 3.3.10 X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] Re: [PATCH] swscale/output: Fix unsigned cast position in yuv2* (PR #20698) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Kieran Kunhya via ffmpeg-devel Cc: michaelni , Kieran Kunhya Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: On Mon, 13 Oct 2025, 14:28 michaelni via ffmpeg-devel, < ffmpeg-devel@ffmpeg.org> wrote: > PR #20698 opened by michaelni > URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20698 > Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20698.patch > > > >From 93794583405909cfe8e7abffdd84c2454959ff18 Mon Sep 17 00:00:00 2001 > From: Michael Niedermayer > Date: Mon, 13 Oct 2025 14:32:45 +0200 > Subject: [PATCH 1/2] swscale/output: Fix integer overflow in > yuv2ya16_X_c_template() > > Found-by: colod colod > > Signed-off-by: Michael Niedermayer > --- > libswscale/output.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/libswscale/output.c b/libswscale/output.c > index b873276c00..cb6630bd73 100644 > --- a/libswscale/output.c > +++ b/libswscale/output.c > @@ -1028,7 +1028,7 @@ yuv2ya16_X_c_template(SwsInternal *c, const int16_t > *lumFilter, > int A = 0xffff; > > for (j = 0; j < lumFilterSize; j++) > - Y += (unsigned)(lumSrc[j][i] * lumFilter[j]); > + Y += lumSrc[j][i] * (unsigned)lumFilter[j]; > > Y >>= 15; > Y += (1<<3) + 0x8000; > @@ -1037,7 +1037,7 @@ yuv2ya16_X_c_template(SwsInternal *c, const int16_t > *lumFilter, > if (hasAlpha) { > A = -0x40000000 + (1<<14); > for (j = 0; j < lumFilterSize; j++) > - A += (unsigned)(alpSrc[j][i] * lumFilter[j]); > + A += alpSrc[j][i] * (unsigned)lumFilter[j]; > > A >>= 15; > A += 0x8000; > -- > 2.49.1 > > > >From 9d0761453e5ecaa1344d63e2fcc9bd3cc6d4d0f6 Mon Sep 17 00:00:00 2001 > From: Michael Niedermayer > Date: Mon, 13 Oct 2025 14:46:16 +0200 > Subject: [PATCH 2/2] swscale/output: Fix unsigned cast position in yuv2* > > Fixes: signed overflow > > Signed-off-by: Michael Niedermayer > --- > libswscale/output.c | 90 ++++++++++++++++++++++----------------------- > 1 file changed, 45 insertions(+), 45 deletions(-) > > diff --git a/libswscale/output.c b/libswscale/output.c > index cb6630bd73..877db04f36 100644 > --- a/libswscale/output.c > +++ b/libswscale/output.c > @@ -503,8 +503,8 @@ static void yuv2nv12cX_c(enum AVPixelFormat dstFormat, > const uint8_t *chrDither, > int v = chrDither[(i + 3) & 7] << 12; > int j; > for (j=0; j - u += (unsigned)(chrUSrc[j][i] * chrFilter[j]); > - v += (unsigned)(chrVSrc[j][i] * chrFilter[j]); > + u += chrUSrc[j][i] * (unsigned)chrFilter[j]; > + v += chrVSrc[j][i] * (unsigned)chrFilter[j]; > } > > dest[2*i]= av_clip_uint8(u>>19); > @@ -516,8 +516,8 @@ static void yuv2nv12cX_c(enum AVPixelFormat dstFormat, > const uint8_t *chrDither, > int v = chrDither[(i + 3) & 7] << 12; > int j; > for (j=0; j - u += (unsigned)(chrUSrc[j][i] * chrFilter[j]); > - v += (unsigned)(chrVSrc[j][i] * chrFilter[j]); > + u += chrUSrc[j][i] * (unsigned)chrFilter[j]; > + v += chrVSrc[j][i] * (unsigned)chrFilter[j]; > } > > dest[2*i]= av_clip_uint8(v>>19); > @@ -577,8 +577,8 @@ static void yuv2p01xcX_c(int big_endian, const uint8_t > *chrDither, > int v = 1 << (shift - 1); > > for (j = 0; j < chrFilterSize; j++) { > - u += (unsigned)(chrUSrc[j][i] * chrFilter[j]); > - v += (unsigned)(chrVSrc[j][i] * chrFilter[j]); > + u += chrUSrc[j][i] * (unsigned)chrFilter[j]; > + v += chrVSrc[j][i] * (unsigned)chrFilter[j]; > } > > output_pixel(&dest[2*i] , u); > @@ -678,8 +678,8 @@ yuv2mono_X_c_template(SwsInternal *c, const int16_t > *lumFilter, > int Y2 = 1 << 18; > > for (j = 0; j < lumFilterSize; j++) { > - Y1 += (unsigned)(lumSrc[j][i] * lumFilter[j]); > - Y2 += (unsigned)(lumSrc[j][i+1] * lumFilter[j]); > + Y1 += lumSrc[j][i] * (unsigned)lumFilter[j]; > + Y2 += lumSrc[j][i+1] * (unsigned)lumFilter[j]; > } > Y1 >>= 19; > Y2 >>= 19; > @@ -896,12 +896,12 @@ yuv2422_X_c_template(SwsInternal *c, const int16_t > *lumFilter, > int V = 1 << 18; > > for (j = 0; j < lumFilterSize; j++) { > - Y1 += (unsigned)(lumSrc[j][i * 2] * lumFilter[j]); > - Y2 += (unsigned)(lumSrc[j][i * 2 + 1] * lumFilter[j]); > + Y1 += lumSrc[j][i * 2] * (unsigned)lumFilter[j]; > + Y2 += lumSrc[j][i * 2 + 1] * (unsigned)lumFilter[j]; > } > for (j = 0; j < chrFilterSize; j++) { > - U += (unsigned)(chrUSrc[j][i] * chrFilter[j]); > - V += (unsigned)(chrVSrc[j][i] * chrFilter[j]); > + U += chrUSrc[j][i] * (unsigned)chrFilter[j]; > + V += chrVSrc[j][i] * (unsigned)chrFilter[j]; > } > Y1 >>= 19; > Y2 >>= 19; > @@ -1802,12 +1802,12 @@ yuv2rgb_X_c_template(SwsInternal *c, const int16_t > *lumFilter, > const void *r, *g, *b; > > for (j = 0; j < lumFilterSize; j++) { > - Y1 += (unsigned)(lumSrc[j][i * 2] * lumFilter[j]); > - Y2 += (unsigned)(lumSrc[j][i * 2 + 1] * lumFilter[j]); > + Y1 += lumSrc[j][i * 2] * (unsigned)lumFilter[j]; > + Y2 += lumSrc[j][i * 2 + 1] * (unsigned)lumFilter[j]; > } > for (j = 0; j < chrFilterSize; j++) { > - U += (unsigned)(chrUSrc[j][i] * chrFilter[j]); > - V += (unsigned)(chrVSrc[j][i] * chrFilter[j]); > + U += chrUSrc[j][i] * (unsigned)chrFilter[j]; > + V += chrVSrc[j][i] * (unsigned)chrFilter[j]; > } > Y1 >>= 19; > Y2 >>= 19; > @@ -1817,8 +1817,8 @@ yuv2rgb_X_c_template(SwsInternal *c, const int16_t > *lumFilter, > A1 = 1 << 18; > A2 = 1 << 18; > for (j = 0; j < lumFilterSize; j++) { > - A1 += (unsigned)(alpSrc[j][i * 2 ] * lumFilter[j]); > - A2 += (unsigned)(alpSrc[j][i * 2 + 1] * lumFilter[j]); > + A1 += alpSrc[j][i * 2 ] * (unsigned)lumFilter[j]; > + A2 += alpSrc[j][i * 2 + 1] * (unsigned)lumFilter[j]; > } > A1 >>= 19; > A2 >>= 19; > @@ -2179,11 +2179,11 @@ yuv2rgb_full_X_c_template(SwsInternal *c, const > int16_t *lumFilter, > int V = (1<<9)-(128 << 19); > > for (j = 0; j < lumFilterSize; j++) { > - Y += (unsigned)(lumSrc[j][i] * lumFilter[j]); > + Y += lumSrc[j][i] * (unsigned)lumFilter[j]; > } > for (j = 0; j < chrFilterSize; j++) { > - U += (unsigned)(chrUSrc[j][i] * chrFilter[j]); > - V += (unsigned)(chrVSrc[j][i] * chrFilter[j]); > + U += chrUSrc[j][i] * (unsigned)chrFilter[j]; > + V += chrVSrc[j][i] * (unsigned)chrFilter[j]; > } > Y >>= 10; > U >>= 10; > @@ -2191,7 +2191,7 @@ yuv2rgb_full_X_c_template(SwsInternal *c, const > int16_t *lumFilter, > if (hasAlpha) { > A = 1 << 18; > for (j = 0; j < lumFilterSize; j++) { > - A += (unsigned)(alpSrc[j][i] * lumFilter[j]); > + A += alpSrc[j][i] * (unsigned)lumFilter[j]; > } > A >>= 19; > if (A & 0x100) > @@ -2360,11 +2360,11 @@ yuv2gbrp_full_X_c(SwsInternal *c, const int16_t > *lumFilter, > int R, G, B; > > for (j = 0; j < lumFilterSize; j++) > - Y += (unsigned)(lumSrc[j][i] * lumFilter[j]); > + Y += lumSrc[j][i] * (unsigned)lumFilter[j]; > > for (j = 0; j < chrFilterSize; j++) { > - U += (unsigned)(chrUSrc[j][i] * chrFilter[j]); > - V += (unsigned)(chrVSrc[j][i] * chrFilter[j]); > + U += chrUSrc[j][i] * (unsigned)chrFilter[j]; > + V += chrVSrc[j][i] * (unsigned)chrFilter[j]; > } > > Y >>= 10; > @@ -2375,7 +2375,7 @@ yuv2gbrp_full_X_c(SwsInternal *c, const int16_t > *lumFilter, > A = 1 << 18; > > for (j = 0; j < lumFilterSize; j++) > - A += (unsigned)(alpSrc[j][i] * lumFilter[j]); > + A += alpSrc[j][i] * (unsigned)lumFilter[j]; > > if (A & 0xF8000000) > A = av_clip_uintp2(A, 27); > @@ -2679,7 +2679,7 @@ yuv2ya8_X_c(SwsInternal *c, const int16_t *lumFilter, > int Y = 1 << 18, A = 1 << 18; > > for (j = 0; j < lumFilterSize; j++) > - Y += (unsigned)(lumSrc[j][i] * lumFilter[j]); > + Y += lumSrc[j][i] * (unsigned)lumFilter[j]; > > Y >>= 19; > if (Y & 0x100) > @@ -2687,7 +2687,7 @@ yuv2ya8_X_c(SwsInternal *c, const int16_t *lumFilter, > > if (hasAlpha) { > for (j = 0; j < lumFilterSize; j++) > - A += (unsigned)(alpSrc[j][i] * lumFilter[j]); > + A += alpSrc[j][i] * (unsigned)lumFilter[j]; > > A >>= 19; > > @@ -2793,11 +2793,11 @@ yuv2v30_X_c_template(SwsInternal *c, const int16_t > *lumFilter, > int j; > > for (j = 0; j < lumFilterSize; j++) > - Y += (unsigned)(lumSrc[j][i] * lumFilter[j]); > + Y += lumSrc[j][i] * (unsigned)lumFilter[j]; > > for (j = 0; j < chrFilterSize; j++) { > - U += (unsigned)(chrUSrc[j][i] * chrFilter[j]); > - V += (unsigned)(chrVSrc[j][i] * chrFilter[j]); > + U += chrUSrc[j][i] * (unsigned)chrFilter[j]; > + V += chrVSrc[j][i] * (unsigned)chrFilter[j]; > } > > Y = av_clip_uintp2(Y >> 17, 10); > @@ -2847,11 +2847,11 @@ yuv2xv36_X_c(SwsInternal *c, const int16_t > *lumFilter, > int j; > > for (j = 0; j < lumFilterSize; j++) > - Y += (unsigned)(lumSrc[j][i] * lumFilter[j]); > + Y += lumSrc[j][i] * (unsigned)lumFilter[j]; > > for (j = 0; j < chrFilterSize; j++) { > - U += (unsigned)(chrUSrc[j][i] * chrFilter[j]); > - V += (unsigned)(chrVSrc[j][i] * chrFilter[j]); > + U += chrUSrc[j][i] * (unsigned)chrFilter[j]; > + V += chrVSrc[j][i] * (unsigned)chrFilter[j]; > } > > output_pixels(dest + 8 * i + 2, Y, 15, 12, 4) > @@ -3011,13 +3011,13 @@ yuv2ayuv_X_c_template(SwsInternal *c, const > int16_t *lumFilter, > int V = 1 << 18, A = 255; > > for (j = 0; j < lumFilterSize; j++) > - Y += (unsigned)(lumSrc[j][i] * lumFilter[j]); > + Y += lumSrc[j][i] * (unsigned)lumFilter[j]; > > for (j = 0; j < chrFilterSize; j++) > - U += (unsigned)(chrUSrc[j][i] * chrFilter[j]); > + U += chrUSrc[j][i] * (unsigned)chrFilter[j]; > > for (j = 0; j < chrFilterSize; j++) > - V += (unsigned)(chrVSrc[j][i] * chrFilter[j]); > + V += chrVSrc[j][i] * (unsigned)chrFilter[j]; > > Y >>= 19; > U >>= 19; > @@ -3034,7 +3034,7 @@ yuv2ayuv_X_c_template(SwsInternal *c, const int16_t > *lumFilter, > A = 1 << 18; > > for (j = 0; j < lumFilterSize; j++) > - A += (unsigned)(alpSrc[j][i] * lumFilter[j]); > + A += alpSrc[j][i] * (unsigned)lumFilter[j]; > > A >>= 19; > > @@ -3105,13 +3105,13 @@ AYUVPACKEDWRAPPER(uyva, AV_PIX_FMT_UYVA) > int U = 1 << (shift - 1), V = 1 << (shift - 1); \ > \ > for (j = 0; j < lumFilterSize; j++) { \ > - Y1 += (unsigned)(lumSrc[j][i * 2] * lumFilter[j]); > \ > - Y2 += (unsigned)(lumSrc[j][i * 2 + 1] * lumFilter[j]); > \ > + Y1 += lumSrc[j][i * 2] * (unsigned)lumFilter[j]; > \ > + Y2 += lumSrc[j][i * 2 + 1] * (unsigned)lumFilter[j]; > \ > } \ > \ > for (j = 0; j < chrFilterSize; j++) { \ > - U += (unsigned)(chrUSrc[j][i] * chrFilter[j]); > \ > - V += (unsigned)(chrVSrc[j][i] * chrFilter[j]); > \ > + U += chrUSrc[j][i] * (unsigned)chrFilter[j]; > \ > + V += chrVSrc[j][i] * (unsigned)chrFilter[j]; > \ > } \ > \ > output_pixel(dest + 8 * i + 0, Y1, bits); \ > @@ -3259,13 +3259,13 @@ yuv2vyu444_X_c(SwsInternal *c, const int16_t > *lumFilter, > int V = 1 << 18; > > for (j = 0; j < lumFilterSize; j++) > - Y += (unsigned)(lumSrc[j][i] * lumFilter[j]); > + Y += lumSrc[j][i] * (unsigned)lumFilter[j]; > > for (j = 0; j < chrFilterSize; j++) > - U += (unsigned)(chrUSrc[j][i] * chrFilter[j]); > + U += chrUSrc[j][i] * (unsigned)chrFilter[j]; > > for (j = 0; j < chrFilterSize; j++) > - V += (unsigned)(chrVSrc[j][i] * chrFilter[j]); > + V += chrVSrc[j][i] * (unsigned)chrFilter[j]; > > Y >>= 19; > U >>= 19; > -- > 2.49.1 > Seems fine > _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org