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 3EB5C45C91 for ; Sun, 2 Apr 2023 19:33:38 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5483768BE9D; Sun, 2 Apr 2023 22:33:37 +0300 (EEST) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D133768BE9D for ; Sun, 2 Apr 2023 22:33:30 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 99187E897B for ; Sun, 2 Apr 2023 21:33:17 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7ylD4bED2wks for ; Sun, 2 Apr 2023 21:33:15 +0200 (CEST) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id 9A7B3E7CDC for ; Sun, 2 Apr 2023 21:33:15 +0200 (CEST) Date: Sun, 2 Apr 2023 21:33:15 +0200 (CEST) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: <20230326211423.2455-1-cus@passwd.hu> Message-ID: <28c648aa-caed-6f52-b7b7-36fbd59c3087@passwd.hu> References: <20230326211423.2455-1-cus@passwd.hu> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] avformat/mxfdec: treat Random Index Pack as end of file 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Sun, 26 Mar 2023, Marton Balint wrote: > RIP, if exists is the last KLV item in the MXF files therefore we can stop > parsing the file if it is encountered. This allows us to support files created by > broken muxers such as OpenCube MXFTk Advanced 2.8.0.0.1. which dumps some extra > garbage after the RIP. Will apply soon. Regards, Marton > > Signed-off-by: Marton Balint > --- > libavformat/mxfdec.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c > index 4530617207..8a7008b298 100644 > --- a/libavformat/mxfdec.c > +++ b/libavformat/mxfdec.c > @@ -3739,7 +3739,10 @@ static int mxf_read_header(AVFormatContext *s) > while (!avio_feof(s->pb)) { > const MXFMetadataReadTableEntry *metadata; > > - if (klv_read_packet(&klv, s->pb) < 0) { > + ret = klv_read_packet(&klv, s->pb); > + if (ret < 0 || IS_KLV_KEY(klv.key, ff_mxf_random_index_pack_key)) { > + if (ret >= 0 && avio_size(s->pb) > klv.next_klv) > + av_log(s, AV_LOG_WARNING, "data after the RandomIndexPack, assuming end of file\n"); > /* EOF - seek to previous partition or stop */ > if(mxf_parse_handle_partition_or_eof(mxf) <= 0) > break; > -- > 2.35.3 > > _______________________________________________ > 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". > _______________________________________________ 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".