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 32BD349BD5 for ; Mon, 3 Jun 2024 02:15:59 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C51CD68D67B; Mon, 3 Jun 2024 05:15:36 +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 7C62E68D66A for ; Mon, 3 Jun 2024 05:15:30 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id CAAB760002 for ; Mon, 3 Jun 2024 02:15:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1717380930; 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=DsFN+AJ/ke9Xij0BmOEpkFLzR3lTRekCb8MdlmeOzb4=; b=in+PnnA3Kxj64Cb7VoGQA0Utb9Z3q9oVwNr625uwokHElMDaCHY1/8smj79NmUZr9cr4ct E10okoijdTqHFepjtNPtkt8DuwLZq1RARdL5cA4zLjzhWCGFIpcY0K4spK377Ehu/yNNXv U+Pc2A8sGtvPfdfJMJti2MvkRq/SSpyDk8KAA829C37Qp7rFM5dmPFsfmEyx8B4saRVVjw /zyZFLxhYd9Z0sIiIIZ7GRgBmvWx89ap4kABQq7FOKeTw/Mdm9EwW1+Kd09IUgMG/ajJuD YCQr48xrrHeU9WR9bDNlcR1CiXvuGxzWZIBN9eW76HPrNNgZtEYeSRi6yw7qvA== From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Mon, 3 Jun 2024 04:15:20 +0200 Message-ID: <20240603021526.2372698-3-michael@niedermayer.cc> X-Mailer: git-send-email 2.45.1 In-Reply-To: <20240603021526.2372698-1-michael@niedermayer.cc> References: <20240603021526.2372698-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 3/9] avformat/imfdec: Simplify get_next_track_with_minimum_timestamp() 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: This also makes the code more robust Fixes: CID1512414 Uninitialized pointer read Sponsored-by: Sovereign Tech Fund Signed-off-by: Michael Niedermayer --- libavformat/imfdec.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c index 32208f89ccd..a86b4763ff8 100644 --- a/libavformat/imfdec.c +++ b/libavformat/imfdec.c @@ -695,12 +695,9 @@ static int imf_read_header(AVFormatContext *s) static IMFVirtualTrackPlaybackCtx *get_next_track_with_minimum_timestamp(AVFormatContext *s) { IMFContext *c = s->priv_data; - IMFVirtualTrackPlaybackCtx *track; + IMFVirtualTrackPlaybackCtx *track = NULL; AVRational minimum_timestamp = av_make_q(INT32_MAX, 1); - if (!c->track_count) - return NULL; - for (uint32_t i = c->track_count; i > 0; i--) { av_log(s, AV_LOG_TRACE, "Compare track %d timestamp " AVRATIONAL_FORMAT " to minimum " AVRATIONAL_FORMAT -- 2.45.1 _______________________________________________ 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".