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 A80C048FEE for ; Mon, 1 Apr 2024 16:23:00 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 262F768CD27; Mon, 1 Apr 2024 19:22:57 +0300 (EEST) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 45DDF68CA93 for ; Mon, 1 Apr 2024 19:22:50 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 99110EA1D9 for ; Mon, 1 Apr 2024 18:22:49 +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 V2WQ4-U6w7F8 for ; Mon, 1 Apr 2024 18:22:47 +0200 (CEST) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id 96AE2E9F76 for ; Mon, 1 Apr 2024 18:22:47 +0200 (CEST) Date: Mon, 1 Apr 2024 18:22:47 +0200 (CEST) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: <20240401160835.19523-1-michael@niedermayer.cc> Message-ID: <3faabf91-87d3-66ec-8210-c5d893acda05@passwd.hu> References: <20240401160835.19523-1-michael@niedermayer.cc> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] avformat/mxfdec: Check that edit_unit_byte_count is not negative 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 Mon, 1 Apr 2024, Michael Niedermayer wrote: > Signed-off-by: Michael Niedermayer > --- > libavformat/mxfdec.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c > index e484db052ef..37446963369 100644 > --- a/libavformat/mxfdec.c > +++ b/libavformat/mxfdec.c > @@ -1245,9 +1245,13 @@ static int mxf_read_index_entry_array(AVIOContext *pb, MXFIndexTableSegment *seg > static int mxf_read_index_table_segment(void *arg, AVIOContext *pb, int tag, int size, UID uid, int64_t klv_offset) > { > MXFIndexTableSegment *segment = arg; > + int tmp; > switch(tag) { > case 0x3F05: > - segment->edit_unit_byte_count = avio_rb32(pb); Why not simply make segment->edit_unit_byte_count unsigned? Thanks, Marton > + tmp = avio_rb32(pb); > + if (tmp < 0) > + return AVERROR_INVALIDDATA; > + segment->edit_unit_byte_count = tmp; > av_log(NULL, AV_LOG_TRACE, "EditUnitByteCount %d\n", segment->edit_unit_byte_count); > break; > case 0x3F06: > -- > 2.17.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". > _______________________________________________ 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".