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 6D56E47694 for ; Sun, 16 Jun 2024 23:09:58 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 746D468D775; Mon, 17 Jun 2024 02:08:54 +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 4533B68D746 for ; Mon, 17 Jun 2024 02:08:41 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id A463CC0003 for ; Sun, 16 Jun 2024 23:08:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1718579320; 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=ZhkT47Mwt8xYBz9OpIq6/kyL0Nxjrrsdxz1JKfgbJGs=; b=D4OLegjoBJK3wVgIMftwUm8P7q1c4Z7zrVL+xfINbZS4xpVAwiDX0sJEy6WpHGwByq18ei Y9eUXJAYkOlttdSBkyphtXAEpR8RMwewhkkMrI73bhCgkziSTcFBonTs3dhi3wxViU6uWn iA0uhBhI0VD7pYvBSmB7YnfxR3hxg5TwzsL4rzwhWxyw2b3QKIxc009GN/EojIjucfZWo/ /GGlK0KtRiVfY3vwmO+zxDor26rq8HzKHGN50BgFymxJQBvwlA1PlYPtL64zObTkEpAwm3 PtZ+0ukGnNKru/6Itjr3A0c7XvcRez2bbSCwmlN8UOJeX5zwgibEeJpZkKCeMA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 17 Jun 2024 01:08:31 +0200 Message-ID: <20240616230831.912377-9-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240616230831.912377-1-michael@niedermayer.cc> References: <20240616230831.912377-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 9/9] avcodec/r210enc: Use av_rescale for bitrate 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: 281612954574848 * 65344 cannot be represented in type 'long' Fixes: 68956/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_R210_fuzzer-6459074458746880 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavcodec/r210enc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/r210enc.c b/libavcodec/r210enc.c index 91e34528741..ec1ebc8d609 100644 --- a/libavcodec/r210enc.c +++ b/libavcodec/r210enc.c @@ -35,7 +35,7 @@ static av_cold int encode_init(AVCodecContext *avctx) avctx->bits_per_coded_sample = 32; if (avctx->width > 0) - avctx->bit_rate = ff_guess_coded_bitrate(avctx) * aligned_width / avctx->width; + avctx->bit_rate = av_rescale(ff_guess_coded_bitrate(avctx), aligned_width, avctx->width); return 0; } -- 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".