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 5B4A04B54B for ; Fri, 7 Jun 2024 23:18:13 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 65D0768D854; Sat, 8 Jun 2024 02:18:11 +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 33CF768CDAE for ; Sat, 8 Jun 2024 02:18:05 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 18A8820003 for ; Fri, 7 Jun 2024 23:18:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1717802284; 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=423Rajr6QouQ56D+RaX5CD8cW8ZgE+zWv92fL4ferOw=; b=c3+xQPC4vvJWdPnNBG0KM8wri4K6mkvzwdcO4xXUa5EBjR+ByvYuyETExXF44g2oT6Hm3b M3e+78NjSmU8f6CGa1y3MIOQMQEOdLCUzAintXIciPdxSDDrrT1WL0PKk9ImhIZoc4h60n nWzelTJBQ1tLZjDtYbzWtZk66117vKc6DVjvBHvGiibMJ4EB7WjqhszA0P5yCoGTG0Eoo3 rPrZijtXcjLPfCWAQKY6XMkbTLbTlT0D4qNj/kswW5hu8c/0kfpIm7Xe83lo64kapA0yNG Ve7P2EgAmimzaTlyzWOaxiB05/Cxuyv1NU+FJExLDqxoc0J/E4WiP+PsjcGvAw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Sat, 8 Jun 2024 01:18:00 +0200 Message-ID: <20240607231803.3017607-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 1/4] avformat/rmdec: use 64bit for audio_framesize 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: It is not entirely clear what would prevent such overflow so even if it is not possible, it is better to use 64bit Fixes: CID1491898 Unintentional integer overflow Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavformat/rmdec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 4ccb0895962..25a8681cfd3 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -268,9 +268,9 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb, case DEINT_ID_INT4: if (ast->coded_framesize > ast->audio_framesize || sub_packet_h <= 1 || - ast->coded_framesize * (uint64_t)sub_packet_h > (2 + (sub_packet_h & 1)) * ast->audio_framesize) + ast->coded_framesize * (uint64_t)sub_packet_h > (2LL + (sub_packet_h & 1)) * ast->audio_framesize) return AVERROR_INVALIDDATA; - if (ast->coded_framesize * (uint64_t)sub_packet_h != 2*ast->audio_framesize) { + if (ast->coded_framesize * (uint64_t)sub_packet_h != 2LL*ast->audio_framesize) { avpriv_request_sample(s, "mismatching interleaver parameters"); return AVERROR_INVALIDDATA; } -- 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".