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 AFF5248120 for ; Tue, 9 Jul 2024 13:17:41 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 905DB68DCA0; Tue, 9 Jul 2024 16:17:37 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2D9E168D8B2 for ; Tue, 9 Jul 2024 16:17:31 +0300 (EEST) Authentication-Results: mail0.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=o6mZT3Qd; dkim-atps=neutral Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 11FD2240DAE for ; Tue, 9 Jul 2024 15:17:30 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id wgmY4iSL-bdd for ; Tue, 9 Jul 2024 15:17:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1720531049; bh=GUBb7mjkhzatJ/R7feAPU9uc5rwYBR7qNnVAdX4EAK4=; h=Subject:From:To:In-Reply-To:References:Date:From; b=o6mZT3Qd2qCL43qx0C+zC6TdtB4J0GjQVLvl9Jf7yEfWtOXmXGHIpYiKYFmh58h9t 9I/oBnUa4x94IlEUvR5fBcAtbtcziCZT+DlIjd1jq6S9OJUIBgGEjSErfH4JgPQWE+ vMb9MPXNYpXfSyVYMmFfwGWqfsRQrx+OiZ4aO57QjzEPVmyOTLZP/fZy+Jxb0znkHd ZU6gdYb8Dq5rrJKD74szBNXvsKr1x02fdp57o3SwSsSPQsdHx2u91T36oO+vTqvCWI eWKxbyS6zAkXn1F77i4kJojHjZvDo6SINNUZBS5pN13570szfPWq0d+the4HHD2OA7 WqDzTnkcSw6mQ== Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 1A9832404E5 for ; Tue, 9 Jul 2024 15:17:29 +0200 (CEST) Received: by lain.khirnov.net (Postfix, from userid 1000) id ECCAB1601B9; Tue, 9 Jul 2024 15:17:28 +0200 (CEST) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <20240709113711.1836747-1-michael@niedermayer.cc> References: <20240709113711.1836747-1-michael@niedermayer.cc> Mail-Followup-To: FFmpeg development discussions and patches Date: Tue, 09 Jul 2024 15:17:28 +0200 Message-ID: <172053104893.21847.7749073807798840029@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH v2] avfilter/vf_scale: Cleanup some checks 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: Quoting Michael Niedermayer (2024-07-09 13:37:11) > Fixes: CID1513722 Operands don't affect result > > Sponsored-by: Sovereign Tech Fund > Signed-off-by: Michael Niedermayer > --- > libavfilter/vf_scale.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c > index bf09196e10d..18e9393d6c1 100644 > --- a/libavfilter/vf_scale.c > +++ b/libavfilter/vf_scale.c > @@ -645,10 +645,8 @@ static int config_props(AVFilterLink *outlink) > if (ret < 0) > goto fail; > > - if (outlink->w > INT_MAX || > - outlink->h > INT_MAX || > - (outlink->h * inlink->w) > INT_MAX || > - (outlink->w * inlink->h) > INT_MAX) > + if ((outlink->h * (int64_t)inlink->w) > INT32_MAX || > + (outlink->w * (int64_t)inlink->h) > INT32_MAX) This does not seems cleaner to me. Also, this check overall seems fishy. Why is it here at all and not e.g. in ff_scale_adjust_dimensions()? Why does it not call av_image_check_size()? Why does it only print a warning and not do anything else? -- Anton Khirnov _______________________________________________ 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".