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 484604B5CC for ; Tue, 9 Jul 2024 11:37:20 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 463A668DC9D; Tue, 9 Jul 2024 14:37:19 +0300 (EEST) Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 42A3068DC07 for ; Tue, 9 Jul 2024 14:37:13 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id A4E19C0006 for ; Tue, 9 Jul 2024 11:37:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720525032; 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; bh=IECNZBhRvuK7h6N4wLrKfCOJt8culz8SPtiZdENO3Ic=; b=BqklnAfdXU3mJnBX+TVzyGeCPX2axVc2f1Nynp42cNPobGg/TL1gfyOagu12H/00AGWyCu oSEdYMGiFVMh+RBVr2uRahnU2WdQ7OuExw96D1FKFhZkmVhSVv8xQaoEHj1SLFNeIjRuRU qqFMU47myG9erkQqPNC9u1S5qsInfgWVohME+KFWMcEPy3jA9kIi2XW4tHF8wwKG38ReYs KvQoyOsPDjnuiyYmErc0Qgu56Vv9+vdQnRrJGdcLUtvbQbkcAdQCJW1zFb5Z1nNNLsb7Qp 9W3coydcI1ekv9KVZI2hCO31/riMggcMZdA/ituO3lxxIa62XMx2xnUUeSJhHA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 9 Jul 2024 13:37:11 +0200 Message-ID: <20240709113711.1836747-1-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [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: 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) av_log(ctx, AV_LOG_ERROR, "Rescaled value for width or height is too big.\n"); /* TODO: make algorithm configurable */ -- 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".