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 C0F8D4B624 for ; Wed, 10 Jul 2024 15:50:07 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2B19468D9D2; Wed, 10 Jul 2024 18:50:05 +0300 (EEST) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 138A968D9A5 for ; Wed, 10 Jul 2024 18:49:58 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 1CF9060004 for ; Wed, 10 Jul 2024 15:49:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720626597; 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=MDKx4eudCZ2wru1vLlQFkOx+DbFBNsY7Xv3D21jTkEg=; b=ndi+WhWI7PUDTLh18OH4sMdciPL5+PSMVXBFKMItX2H4l/fKJ2vOBbs542vt+Be7H770mV vz3M0kwB8i9EDKyWFXiMPV8iAIaN2cOkvGgrs5fA3UvGh0dUOE5aKgH2rjMgRBI+YgfMi9 8CcYzv4lOKfb4dvBjYHa9C45IftyPqwkSMSfw9US5NBqDroItSGjgvWIKcvPy4kF/JjkOm RgSMOnGrpQzawz+49e82A+WlrvFt8tZJVA48t/pAd2r5d7qVpszh15CmSx+UTGbRBgKDFM 7f2ewaoVpJnYEQ5INIweLZsLnuNnLILTS5vwyfMM+MwzsD/lo9vDT0I+ztBOow== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 10 Jul 2024 17:49:56 +0200 Message-ID: <20240710154956.3225816-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] avutil/imgutils: av_image_check_size2() ensure width and height fit in 32bit 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: width and height > 32bit is not supported and its easier to check in a central place Signed-off-by: Michael Niedermayer --- libavutil/imgutils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c index d2463815637..b738cff37c2 100644 --- a/libavutil/imgutils.c +++ b/libavutil/imgutils.c @@ -298,7 +298,7 @@ int av_image_check_size2(unsigned int w, unsigned int h, int64_t max_pixels, enu stride = 8LL*w; stride += 128*8; - if ((int)w<=0 || (int)h<=0 || stride >= INT_MAX || stride*(uint64_t)(h+128) >= INT_MAX) { + if (w==0 || h==0 || w > INT32_MAX || h > INT32_MAX || stride >= INT_MAX || stride*(uint64_t)(h+128) >= INT_MAX) { av_log(&imgutils, AV_LOG_ERROR, "Picture size %ux%u is invalid\n", w, h); return AVERROR(EINVAL); } -- 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".