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 82B97471AC for ; Fri, 26 Apr 2024 03:09:41 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F2D2568D449; Fri, 26 Apr 2024 06:08:54 +0300 (EEST) Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id C1D4468D425 for ; Fri, 26 Apr 2024 06:08:45 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 3057740003 for ; Fri, 26 Apr 2024 03:08:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1714100925; 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=LcFf3/P0dIO5c/F3G5DHeCfHn/yWWjvDLAYblZ1OEmQ=; b=aKg4/VnXo9jISsB4oDjNVlGzh4e0BOVEsW58osefkmMXG44416ytgrxwrYaxwxlqPg6I2m Ijx/SaO1JZzkxl5oy7SxRt9lFbC9IjMbKRmvgIYlJmQIF4GhSfJvpmgUSl1ZVXQjI0LL5W Lk+AUKRbkO01UFODov+J1NxVpB5BpPC5yHbZNdoVFM7h/w52TimFcX0tQk2bJ9apptJpdA kRpGfnLUQ3mqfunrfTsWcRSjagX75uM8gNggymNwNnzwLL5SWYAzjueON2GyxSIQxI9D4N PaRlXoY3YxUG7+LGTK2bKEK+LuCTL7kLyQzsCaX6T6YsB3NjMASC7ppOQr6t7g== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 26 Apr 2024 05:08:39 +0200 Message-ID: <20240426030839.3001504-6-michael@niedermayer.cc> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240426030839.3001504-1-michael@niedermayer.cc> References: <20240426030839.3001504-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 6/6] avformat/mxfdec: Check body_offset 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: 538976288 - -9223372036315799520 cannot be represented in type 'long' Fixes: 68060/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-5523457266745344 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer --- libavformat/mxfdec.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 233d614f783..e65cec74c23 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -791,6 +791,9 @@ static int mxf_read_partition_pack(void *arg, AVIOContext *pb, int tag, int size partition->index_sid = avio_rb32(pb); partition->body_offset = avio_rb64(pb); partition->body_sid = avio_rb32(pb); + if (partition->body_offset < 0) + return AVERROR_INVALIDDATA; + if (avio_read(pb, op, sizeof(UID)) != sizeof(UID)) { av_log(mxf->fc, AV_LOG_ERROR, "Failed reading UID\n"); return AVERROR_INVALIDDATA; -- 2.43.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".