From patchwork Fri Aug 26 02:50:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Liu X-Patchwork-Id: 37500 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:139a:b0:8f:1db5:eae2 with SMTP id w26csp78083pzh; Thu, 25 Aug 2022 19:53:53 -0700 (PDT) X-Google-Smtp-Source: AA6agR5H7+rSrZmO6o82naXDTt0Koc3CfdE/6oF+HZkV9QzmmAfQo/u3veYXaWP/reN4phRkUDLC X-Received: by 2002:a05:6402:40cb:b0:446:fd02:f03b with SMTP id z11-20020a05640240cb00b00446fd02f03bmr5091981edb.405.1661482433515; Thu, 25 Aug 2022 19:53:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661482433; cv=none; d=google.com; s=arc-20160816; b=BeSrVFtg3L+XWWI9HqBqZMyi3tQiFPZfZXESbXgkEfHOVjs7+gK5czQHN/pn5WAwlM a8acIJVmFKOWsckudi4lWaqIsRXeGmJpfWyyUa3VYwcC8Bj7yw0QYROeeb4Bew9BwHmp pD25iTpVwn/+nbO8DMN/joXUPo+3Tw/vcj6Pi8TRH1iSfbjd+Kgrm2APY3J6TRpuoILg XbvNOsWidqkq0vPcQZe4Nnb0VVBNjmTFCrLNGRJP2jFCbN2h9pirrx1dgHNreQZx/Nfr SeA4tQTZKtvJ9Oierrj6vFwY7/aHyifV7IfdzkbdNXj7oIQzvL/O9yVv3M2zT7F2chfC jtNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:feedback-id:mime-version:message-id:date :to:from:delivered-to; bh=LzOS2q/+Dnln6NhPWAsvTqDWwRj5O+0VQ8u3qT8rv6s=; b=O2kIx3G7yV48Hu94riVfulSdmiiQGnag7rE1poT1Mh5XDMvQRnf5VHNL/HHIv+qY9F b8yOhGVE2NcM4CRWsTsQDelVJHuZSCw3sCCuDs/J0DpQpyG3icSohCMpnoMclffsFwGZ Evda+QV4z3Sp6IrZ4Dv15SdJ1Xwkk3ys1KDMLVl263X26l6UsrR4f6w+AreWNN1yld1P k9KlKhnyueWnAqR9shgw1QRF56TXF1KAOyfoBbTLurSTIAqtBFimehVbL7ztnEK/L43a 9koQc0B48zr5QISrUHdbaPdENKYSB5q5E0Rn8TUYRKai5UepeIiuBq+/4zVHoDY6h2Tk RKjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id h21-20020aa7cdd5000000b0043c94d7ddb8si510212edw.204.2022.08.25.19.53.52; Thu, 25 Aug 2022 19:53:53 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D2DC168B9D5; Fri, 26 Aug 2022 05:53:48 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from bg5.exmail.qq.com (bg4.exmail.qq.com [43.155.67.158]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 23BDB68B743 for ; Fri, 26 Aug 2022 05:53:40 +0300 (EEST) X-QQ-mid: bizesmtp67t1661482220tfmfa5w7 Received: from localhost ( [103.107.217.224]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 26 Aug 2022 10:50:19 +0800 (CST) X-QQ-SSF: 01100000000000Z0Z000000A0000000 X-QQ-FEAT: swyrzWPvyR3KBMt4KesztSpncqtXMtaS13hP1FzBnG5pTiP2WESsrdfisQl1X SZF4MIkJXp0f83Y6LEZkCEHGNJV0alEX9XLUxemhjEXELAn4CsfgnSu0FTRTDPpWXVMNcu6 5RqSmrfc/D9P4RAIDxdH6WQkCMPr/Aq9UQg78+BqAP2smkLdAefsqGya3kD1QzuUzCDV4Bh IpLlgT2LPXI8I0NrfY83mTm+MgcJMxW9rVhnH5Zooa3WQirmYZ6IDPmVFImmErYyZMtqp5T 9wysd5TxPtlfvSKAymilfhhcb/+rCTSL14qwVfMsbViZzKwBW0OOUbyfUfka5pD2HeNlrG3 8LGwHzos+ZRCO3wBw0= X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Fri, 26 Aug 2022 10:50:15 +0800 Message-Id: <20220826025016.29627-1-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybglogicsvr:qybglogicsvr2 Subject: [FFmpeg-devel] [PATCH 1/2] avformat/imfdec: check track valid before use 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 Cc: Steven Liu Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: ycOybpLCMuh9 fix CID: 1512414 Signed-off-by: Steven Liu --- libavformat/imfdec.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c index 5bbe7a53f8..a97dcc3b8b 100644 --- a/libavformat/imfdec.c +++ b/libavformat/imfdec.c @@ -697,8 +697,9 @@ static IMFVirtualTrackPlaybackCtx *get_next_track_with_minimum_timestamp(AVForma } } - av_log(s, AV_LOG_DEBUG, "Found next track to read: %d (timestamp: %lf / %lf)\n", - track->index, av_q2d(track->current_timestamp), av_q2d(minimum_timestamp)); + if (track) + av_log(s, AV_LOG_DEBUG, "Found next track to read: %d (timestamp: %lf / %lf)\n", + track->index, av_q2d(track->current_timestamp), av_q2d(minimum_timestamp)); return track; }