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 0260E41145 for ; Fri, 7 Jun 2024 00:32:26 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 664B768D72E; Fri, 7 Jun 2024 03:32:24 +0300 (EEST) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7238C68D728 for ; Fri, 7 Jun 2024 03:32:17 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9EF3760002 for ; Fri, 7 Jun 2024 00:32:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1717720336; 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=XCiGjq20S3ILGYi7Dji5bqwkfRoWB27YJYJZ/6+YBZA=; b=jAqaFloZLmtNm/o0DxgXN1ZuPei5ohE3TNnwy7cWjy8sFhwuH5dDtrN+87OfoNUB3xCMZD Hy6iOraTQO7NvofE/p9TtG/guhWHl2rDeBMjXwoI7lq2rEoVnOrOckKL8w76Xu2hvmWXHL 8FMI4fnArHrUAFIXgESBPVyvkDQPZnJwmlJRnuUnwjVBv/37c93oxukgG9LWsJJ2+DAFfs LwYyXQCYvaU2JVtsP7MLvV8CkeNWz+AzQrh8YlOgUwAOHUFZk25gXHTJlio8JBooANv9FE 8FlWYIPKPvdGSo6ftFYVzZjS4AdHsmSMcsGP7Bv955eQnU42kgYYtrqROdjaEw== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Fri, 7 Jun 2024 02:32:11 +0200 Message-ID: <20240607003215.1723906-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/5] avformat/mov: Check requested_sample before using it 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: I am not sure the case described by coverity is possible but its more robust checking the argument first Fixes: CID1598441 Improper use of negative value Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavformat/mov.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mov.c b/libavformat/mov.c index 9016cd5ad08..f571b0468ee 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -10161,7 +10161,7 @@ static int mov_seek_stream(AVFormatContext *s, AVStream *st, int64_t timestamp, // If we've reached a different sample trying to find a good pts to // seek to, give up searching because we'll end up seeking back to // sample 0 on every seek. - if (!can_seek_to_key_sample(st, requested_sample, next_ts) && sample != requested_sample) + if (sample != requested_sample && !can_seek_to_key_sample(st, requested_sample, next_ts)) break; timestamp = next_ts; -- 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".