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 ESMTPS id E5C2A4EAC4 for ; Mon, 12 May 2025 23:59:30 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BEF5C687DC0; Tue, 13 May 2025 02:59:03 +0300 (EEST) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3B150687ABB for ; Tue, 13 May 2025 02:58:38 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9C30C43315 for ; Mon, 12 May 2025 23:58:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1747094317; 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=0rTWkfLFTtk0rWr4LwDKiC1gfbQ0ySh+wKkKBn63Uq4=; b=cvanGHYlCfsdfS0icWzq9n21yjHu7QV3bmT5YVc6eCkBAAAKRMQImI53w7Ar3dTqraPjBP QmMCriE2dJqL0m7eMMCAS4diOg/RfSP4/J3uCZkzM8kCPedGfRUk/mmMCU7hGmVTEhMn2r PRLvdga1gMwQb/ZMH+gTn/XTZJSZPU71VOzpT5Ku8gH5MzK4qEy8I98FuO7nACStRGrwEs bP9vy8/KfSjSaWssS1wXhWkLW4wBlebNUDezh00gWQd0Efp7hhNLmAXPiy0S37KOiy0zdl T5b+yPqzp03aOxaPEx2ZFxwp2APblsXvlrZ5EQWSkCY8dJBmC89WRgcMAjRAWQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 13 May 2025 01:58:32 +0200 Message-ID: <20250512235832.361422-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250512235832.361422-1-michael@niedermayer.cc> References: <20250512235832.361422-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-State: clean X-GND-Score: -85 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdeftddvieegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfghrlhcuvffnffculdduhedmnecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefoihgthhgrvghlucfpihgvuggvrhhmrgihvghruceomhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtqeenucggtffrrghtthgvrhhnpeegjefhteeghffgledugedvuddvffegfedvtdehteelhfeuiedtveffveefheehgfenucffohhmrghinhepghhithhhuhgsrdgtohhmnecukfhppeeguddrieeirdeijedruddufeenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepihhnvghtpeeguddrieeirdeijedruddufedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 5/5] swscale/output: fix integer overflow in yuv2rgba64_full_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: -293650 * 16525 cannot be represented in type 'int' Fixes: 408304111/clusterfuzz-testcase-minimized-ffmpeg_SWS_fuzzer-4762210299871232 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 2a6a20f2e68..c37649e7ce5 100644 --- a/libswscale/output.c +++ b/libswscale/output.c @@ -1435,8 +1435,8 @@ yuv2rgba64_full_1_c_template(SwsInternal *c, const int32_t *buf0, if (uvalpha == 0) { for (i = 0; i < dstW; i++) { SUINT Y = (buf0[i]) >> 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; Y -= c->yuv2rgb_y_offset; @@ -1471,8 +1471,8 @@ yuv2rgba64_full_1_c_template(SwsInternal *c, const int32_t *buf0, for (i = 0; i < dstW; i++) { SUINT Y = (buf0[i] ) >> 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; Y -= 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".