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 8266049CD7 for ; Fri, 20 Jun 2025 00:33:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id EC76668DB22; Fri, 20 Jun 2025 03:33:07 +0300 (EEST) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 7F6FE68DAE2 for ; Fri, 20 Jun 2025 03:32:59 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9C28143A0D for ; Fri, 20 Jun 2025 00:32:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1750379578; 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=c1KXgSz+NfgoW3CycAiywfJVXFkXSxRp+Q8P1gJ7mMk=; b=B2nxfJiTjj2Z/YCCfjCsjYj9HS85RY9vwC+HioCrn+nOLf7L/oFhWuxXgbYNQEgQIX2yFw onB0DXAYZiyYgFIkqZZVPZnSd/wZ1gYKll99BgfMbSDX4kB3XLSH2RlrMTzBzOHx6U79js Q8uio0QwZieWlOvNG0bRWmI21Q1BNSJQ+4l3w10eiT1FFlJIxqMeuWEvi3sLwUmptax2/O jQ5CWRwJezz9iNU/XEUHS5KeVuHW9eYCT7gs/vWYC9YUl9UUvdZUOIjdhHcGGw85kirQIk dX8+NyWlKfrDw8wD9/VCCDi5mTkQ5pmcVE/BtBNgdusOx85YBJzs/VMsXwEOnA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 20 Jun 2025 02:32:50 +0200 Message-ID: <20250620003255.295598-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250620003255.295598-1-michael@niedermayer.cc> References: <20250620003255.295598-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-State: clean X-GND-Score: -85 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgdeileejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdduhedmnecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeegjefhteeghffgledugedvuddvffegfedvtdehteelhfeuiedtveffveefheehgfenucffohhmrghinhepghhithhhuhgsrdgtohhmnecukfhppeeguddrieeirdeijedruddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeguddrieeirdeijedruddufedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/8] swscale/output: Fix integer overflows in yuv2rgba64_1_c_template() 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: Fixes: signed integer overflow: -132524 * 16525 cannot be represented in type 'int' Fixes: 414862270/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-4869083202125824 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libswscale/output.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libswscale/output.c b/libswscale/output.c index c37649e7ce5..c18c96a57a1 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -1211,8 +1211,8 @@ yuv2rgba64_1_c_template(SwsInternal *c, const int32_t *buf0, for (i = 0; i < ((dstW + 1) >> 1); i++) { SUINT Y1 = (buf0[i * 2] ) >> 2; SUINT Y2 = (buf0[i * 2 + 1]) >> 2; - int U = (ubuf0[i] - (128 << 11)) >> 2; - int V = (vbuf0[i] - (128 << 11)) >> 2; + SUINT U = (ubuf0[i] - (128 << 11)) >> 2; + SUINT V = (vbuf0[i] - (128 << 11)) >> 2; int R, G, B; Y1 -= c->yuv2rgb_y_offset; @@ -1260,8 +1260,8 @@ yuv2rgba64_1_c_template(SwsInternal *c, const int32_t *buf0, for (i = 0; i < ((dstW + 1) >> 1); i++) { SUINT Y1 = (buf0[i * 2] ) >> 2; SUINT Y2 = (buf0[i * 2 + 1]) >> 2; - int U = (ubuf0[i] * uvalpha1 + ubuf1[i] * uvalpha - (128 << 23)) >> 14; - int V = (vbuf0[i] * uvalpha1 + vbuf1[i] * uvalpha - (128 << 23)) >> 14; + SUINT U = (ubuf0[i] * uvalpha1 + ubuf1[i] * uvalpha - (128 << 23)) >> 14; + SUINT V = (vbuf0[i] * uvalpha1 + vbuf1[i] * uvalpha - (128 << 23)) >> 14; int R, G, B; Y1 -= c->yuv2rgb_y_offset; -- 2.49.0 _______________________________________________ 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".