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 A9B404D33D for ; Sat, 31 May 2025 13:32:29 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 71C7368DC83; Sat, 31 May 2025 16:32:25 +0300 (EEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id C588B68CE20 for ; Sat, 31 May 2025 16:32:18 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 182F84384E for ; Sat, 31 May 2025 13:32:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1748698338; 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=QMEOhxFbKcgzVCuUK1scv5QfkSh83X6ga7YVzKqwKnU=; b=G+4IKMiWRVTqdcV1ivOBhro1Pm7DF7UD6e3iQsYP9okb4xLMjFcMzP/+b6qDJkO4XoGeGl FbbUVymcQPi/GkrKJxZAjp2ssP+WCY7zObIO6mAAQSa6D5qxT3hbccXx3uX9UwzG2aFsyC ORIt6uvrsbjHNfu2ZxHQbpDUg4Ly/j4yLNExHpSCZYK1JMZ/P4gzHJW1raskODJ6CxpdRj 0tl17vMMbzMtT6oI2y0Qla1HCAiEONrFNyXIkwzo4ASuKkA+/KWwj+a1D6J5pRYkqZmYn/ 0BQ8BCdUGye7x7Omrt96Cq5nq1rS71/S5GO0CIK6w5bfkq2DfLexD3X4phH0ZQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 31 May 2025 15:32:14 +0200 Message-ID: <20250531133215.64025-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250531133215.64025-1-michael@niedermayer.cc> References: <20250531133215.64025-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-State: clean X-GND-Score: -70 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddtgdefvddtfeculddtuddrgeefvddrtddtmdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdlfedtmdenucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofhitghhrggvlhcupfhivgguvghrmhgrhigvrhcuoehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgeqnecuggftrfgrthhtvghrnhepvdfgfeduieejteeijeekgfffhfdtleduueffvdefleeiveejteevudefteefjeefnecukfhppeeguddrieeirdeijedruddufeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeguddrieeirdeijedruddufedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/2] avutil/opt: round min/max in integer context 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: Signed-off-by: Michael Niedermayer --- libavutil/opt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavutil/opt.c b/libavutil/opt.c index 7a84a18bb59..cc4832daeee 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -607,8 +607,8 @@ static int set_string_fmt(void *obj, const AVOption *o, const char *val, uint8_t } } - min = FFMAX(o->min, -1); - max = FFMIN(o->max, fmt_nb-1); + min = FFMAXI(lrint(o->min), -1); + max = FFMINI(lrint(o->max), fmt_nb-1); // hack for compatibility with old ffmpeg if(min == 0 && max == 0) { @@ -958,8 +958,8 @@ static int set_format(void *obj, const char *name, int fmt, int search_flags, if (ret < 0) return ret; - min = FFMAX(o->min, -1); - max = FFMIN(o->max, nb_fmts-1); + min = FFMAXI(lrint(o->min), -1); + max = FFMINI(lrint(o->max), nb_fmts-1); if (fmt < min || fmt > max) { av_log(obj, AV_LOG_ERROR, -- 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".