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 E8EE64AC55 for ; Wed, 17 Jul 2024 11:28:06 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2637068DA54; Wed, 17 Jul 2024 14:27:55 +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 A748068D98F for ; Wed, 17 Jul 2024 14:27:48 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id E972D20005 for ; Wed, 17 Jul 2024 11:27:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1721215668; 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=7IokNtUOjiNjbregTN1M6XcfhuQ/ofBWEAz0deNeIYs=; b=S6qnGcAD2SWyg7BgeFlBBpHSbWs81Fh3znB3oJ+4H4/zsj3+5YVuZnQu/ap9r+r0VmnpCT +rDIn9DfORaGqEGzL3gmTf+0elMyk3R9WoSxdJnlgGqcOXyAtwAr3FGNQq7jw0RGb0tPOw wSRWqhOp6wgx08jzHqrlHdb0tU6yEE/PLiEVg4O1coikHKdveD4DDCTDsREAGF77WuBEHt 7HZ+1KLn6FJmr7Q9Q/Gy4ihY3fIY8uhH5Q296zCgERbCnKQPPL7OfMn4zX/ow5iKi0Lan5 uoHxajhqALyla5Um7cj6VIJKZXAx/FnIifoUHIwRCv6UytkRpMqFjpWgbkZdmA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Wed, 17 Jul 2024 13:27:42 +0200 Message-ID: <20240717112745.1624968-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240717112745.1624968-1-michael@niedermayer.cc> References: <20240717112745.1624968-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 2/5] avformat/mxfdec: Reorder elements of expression in bisect loop 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: 9223372036854775807 - -1 cannot be represented in type 'long' Fixes: 68578/clusterfuzz-testcase-minimized-ffmpeg_dem_MXF_fuzzer-6032171648221184 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, 1 insertion(+), 2 deletions(-) diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index a5863445ab5..af0c8a31007 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -3821,8 +3821,7 @@ static int mxf_get_next_track_edit_unit(MXFContext *mxf, MXFTrack *track, int64_ a = -1; b = track->original_duration; - - while (b - a > 1) { + while (b - 1 > a) { m = (a + b) >> 1; if (mxf_edit_unit_absolute_offset(mxf, t, m, track->edit_rate, NULL, &offset, NULL, 0) < 0) return -1; -- 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".