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 C54B64A6CD for ; Wed, 3 Apr 2024 22:52:20 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7866668D16C; Thu, 4 Apr 2024 01:51:46 +0300 (EEST) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3F8E568D146 for ; Thu, 4 Apr 2024 01:51:39 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 737F520003 for ; Wed, 3 Apr 2024 22:51:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1712184698; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:in-reply-to:in-reply-to:references:references; bh=cvUzKjjAnFxetOEwKzLGx5XlvtczstixMYmWplqJN+I=; b=mB37F14LloKNdBPXkRjWl4jBxOVQJdTZafOWVLkd4liVOW4FFzIgwB7LDVEvFuKEv4exwJ ksPrahQHbEHwtPw6Gno9Dofh0gmD0rbwypWUo3Fn6yqz5OWnVUpRyb+JJRp4p2nhK8lpnQ BduMDZ+KMCi5DFbtewLbYMEMNNaeWFj3Uo3EbjJKnVraaPFkj638zaRnuHHSNFbxfD9e2g FE48aYQ+MqVxF1axZ6otBs3pe+NI60OBp9ftVpmbjHJrBlCo0FsLPnqf+Bp2eQAIvbXMFl YhixZ8AYnO5wsVmuznR/WeyNGCnVt/p3F/AQt8mgJbpdWVeC+5RDJiHzwNMgsQ== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Thu, 4 Apr 2024 00:51:34 +0200 Message-Id: <20240403225134.31764-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240403225134.31764-1-michael@niedermayer.cc> References: <20240403225134.31764-1-michael@niedermayer.cc> X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 5/5] avformat/pcm: Use 64bit in bitrate computation 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 MIME-Version: 1.0 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: 65792 * 65312 cannot be represented in type 'int' Fixes: 67819/clusterfuzz-testcase-minimized-ffmpeg_dem_WADY_fuzzer-5236100912185344 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/pcm.c b/libavformat/pcm.c index 051e86dd464..a774dbc3726 100644 --- a/libavformat/pcm.c +++ b/libavformat/pcm.c @@ -41,7 +41,7 @@ int ff_pcm_default_packet_size(AVCodecParameters *par) /* Don't trust the codecpar bitrate if we can calculate it ourselves */ if (bits_per_sample > 0 && par->sample_rate > 0 && par->ch_layout.nb_channels > 0) if ((int64_t)par->sample_rate * par->ch_layout.nb_channels < INT64_MAX / bits_per_sample) - bitrate = bits_per_sample * par->sample_rate * par->ch_layout.nb_channels; + bitrate = bits_per_sample * (int64_t)par->sample_rate * par->ch_layout.nb_channels; if (bitrate > 0) { nb_samples = av_clip64(bitrate / 8 / PCM_DEMUX_TARGET_FPS / par->block_align, 1, max_samples); -- 2.17.1 _______________________________________________ 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".