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 3748D4AAB8 for ; Thu, 11 Jul 2024 23:35:06 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 0F40268DBA9; Fri, 12 Jul 2024 02:34:31 +0300 (EEST) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 1DF2568DB43 for ; Fri, 12 Jul 2024 02:34:22 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 7BDEDE0004 for ; Thu, 11 Jul 2024 23:34:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720740861; 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=NZzuEmT+3KzMvDwi3Tj5WSKRIM+wxvrGrT/a04Aarko=; b=EIgHfNSZCbvKwTATd+bF758oNqAjHfRgDqD3bKqapAXzYi5M7d7z89zmWWBoLxh1RkYJmv KAZhaoqPwD/mrpXIsxXvkBpQ6EI9JP46NMV+ginN9rtKBDeeg5phc8ohv0iQGTiGnHVdPg TpIyWe+A0szGifEd6gsKE+jfLMQZ83gzLtpfXQ9GAWqAEYVUGL59mrqGBc/FszQNc12eYF fLlBmbwyveYpsM7OT7q9IlPe4Hst/Z02LDLgEcKlRS/r5rAgTQEZZdpU4FO0cTk6ekuZp6 8w3ndecksDE6hiI04CI4DOL71BRzGWAyRrq53HeIvAwoCmvb5ITSz1eqmHaE/Q== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 12 Jul 2024 01:33:59 +0200 Message-ID: <20240711233417.1896879-5-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240711233417.1896879-1-michael@niedermayer.cc> References: <20240711233417.1896879-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 05/22] avformat/matroskadec: Use int64_t size 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: The length is 64bit that is passed into the functions. Alternatively the values can be checked before cast Fixes: CID1604572 Overflowed return value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavformat/matroskadec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index aa28a37da4c..9914838698c 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -989,7 +989,7 @@ static int ebml_read_length(MatroskaDemuxContext *matroska, AVIOContext *pb, * Read the next element as an unsigned int. * Returns NEEDS_CHECKING unless size == 0. */ -static int ebml_read_uint(AVIOContext *pb, int size, +static int ebml_read_uint(AVIOContext *pb, int64_t size, uint64_t default_value, uint64_t *num) { int n = 0; @@ -1010,7 +1010,7 @@ static int ebml_read_uint(AVIOContext *pb, int size, * Read the next element as a signed int. * Returns NEEDS_CHECKING unless size == 0. */ -static int ebml_read_sint(AVIOContext *pb, int size, +static int ebml_read_sint(AVIOContext *pb, int64_t size, int64_t default_value, int64_t *num) { int n = 1; @@ -1033,7 +1033,7 @@ static int ebml_read_sint(AVIOContext *pb, int size, * Read the next element as a float. * Returns 0 if size == 0, NEEDS_CHECKING or < 0 on obvious failure. */ -static int ebml_read_float(AVIOContext *pb, int size, +static int ebml_read_float(AVIOContext *pb, int64_t size, double default_value, double *num) { if (size == 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".